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  

Programming for problem solving : Assignment no 1

 Assignment of programming for problem solving:  The questions for assignment is : The solution for the assignment is as follows :  Please subscribe the blog for more updates . Thank you! 🙏🙏

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