Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import random
- def Greeting(name):
- print('Hello, ' + name )
- print('How are you today')
- def Game():
- input('press any key to roll..')
- me = random.randint(1,6)
- print(f'your number is {me}')
- print()
- print('computer turn')
- comp = random.randint(1,6)
- print(f'computer number is {comp}')
- if(comp>me):
- print('computer wins')
- elif(comp<me):
- print('you win')
- else:
- print('draw')
- # Program start here
- os.system('clear') # for windows use cls
- while(True):
- print('1 - Play Game')
- print('2 - Exit')
- ans = input('1 or 2 ? : ')
- if(ans=='1'):
- print('Playing Game...')
- Game()
- print()
- if(ans=='2'):
- print('Exiting now...')
- print()
- exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement