Skip to main content

15. Program to roll a dice and get number

#Program to roll the dice

while True:
    import random
    print('this is a program to calculate a dice')
    print('press enter ')
    input()
    n=random.randint(1,6)
    if n==1:
          print('[====================]')
          print('[                                             ]')
          print('[          o                                 ]')
          print('[                                             ]')
          print('[====================]')
          
    if(n==2):
         
         
         print('[====================]')
         print('[                                             ]')
         print('[   o                  2              o    ]')
         print('[                                             ]')
         print('[====================]')
         
    if(n==3):
          print('[====================]')
          print('[    o                                 o    ]')
          print('[                      o                     ]')
          print('[                             3              ]')
          print('[====================]')
          
    if(n==4):
          print('[====================]')
          print('[    o                                 o    ]')
          print('[                      4                     ]')
          print('[    o                                 o    ]')
          print('[====================]')
          
    if(n==5):
          print('[====================]')
          print('[    o                                 o    ]')
          print('[                     o                      ]')
          print('[    o                     5           o   ]')
          print('[====================]')
          
    if(n==6):
          print('[====================]')
          print('[    o                                 o    ]')
          print('[    o           6                    o    ]')
          print('[    o                                 o    ]')
          print('[====================]')


Comments

Post a Comment

THANK YOU FOR COMMENTING !
PLEASE SUBSCRIBE TO OUR WEBSITE FOR LATEST UPDATES

Popular posts from this blog

BEE ASSIGNMENT

 Here is the solution of BEE ASSIGNMENT    QUESTION 1 - QUESTION 5 Question 6 to Question 10  For maths assignment : click here  

MATHEMATICS ASSIGNMENT 1

Here is the solution of mathematics assignment 1 . One question is not done. Please provide the correct solution for that question.  Solution of the assignment is as follows: For BEE NOTES : CLICK HERE For MATHS NOTES : CLICK HERE

1. Python program for railway reservation system

def reserve(CLASS):     if CLASS==1:         print('welcome to the REGULAR CLASS SEAT reservation')         dest=int(input('enter your destination in km  '))         stat=int(input('enter stations in between '))         price=10*dest         amount=price+(10*stat)         print('the price for 1 seat is =',amount)         seat=int(input('enter no of seats'))         total=amount*seat         print('your final price is =',total)         print('you will have to pay',total,'INR')         return total,seat,amount     if CLASS==2:         print('welcome to the FIRST CLASS TICKET reservation')         dest=int(input('enter your destination in km  '))         stat=int(input...