Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import random
  2.  
  3. num_computer = random.randint(1,10)
  4. print(num_computer)
  5. name = input('What is your name? \n')
  6. print('Hi', name,',', 'I am thinking about a number between 1 and 10')
  7.  
  8. num_player = int(input('Tell me my number\n'))
  9.  
  10.  
  11. while num_computer != num_player:
  12. print('Wrong, try again!')
  13. num_player = input('Tell me my number again\n')
  14. if num_computer == num_player:
  15. print('Congratulations, that was my number!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement