Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def multiplyGame():
- number1 = random.randint(1, 100)
- number2 = random.randint(1, 10)
- print('What is ' + str(number1) + ' * ' + str(number2) + '?')
- answer = input()
- if int(answer) == number1 * number2:
- print('Correct!')
- else:
- print('Nope! The answer is ' + str(number1 * number2))
- playAgain = 'yes'
- while playAgain == 'yes' or playAgain == 'y':
- multiplyGame()
- print('Do you want to play again? (y or n)')
- playAgain = input()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement