from random import randint from datetime import date #0: Introduction test = randint(1, 10000) date = date.today() iq = randint(100,150) print(f'Today is {date}') print(f'\nYou are test subject #{test}') print(f'You will be put you through a series of tests that will determine your intelect.') print('Your starting IQ will be set to a random integer between 100 and one 150.') print(f'\nIn this case, It has been set to {iq}') #1: User input n1 = int(input('Select a number to be added together: ')) n2 = int(input('Select a second number to be added together: ')) print(f"{n1} + {n2} = {n1 + n2}") ion = int(input('\nSelect addition (1), subtraction (2), multiplucation (3), or division(4) : ')) dif = int(input('Select a number for your difficulty: ')) print("\ntry:") #2: Easy random addition if dif == 1 and ion == 1: n1 = randint(1, 100) n2 = randint(1, 100) ans = int(input(f"{n1} + {n2} = ? ")) if ans == n1 + n2: print('You got it.') iq = iq + randint(1,20) print(f' your IQ has been raised to {iq}') n1 = randint(1, 100) n2 = randint(1, 100) ans = int(input(f"{n1} + {n2} = ? ")) else: print(f'Not quite! The answer was {n1 + n2}.') print('Try again!') n1 = randint(1, 100) n2 = randint(1, 100) ans = int(input(f"{n1} + {n2} = ? ")) iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}') if ans == n1 + n2: print('You got it!') iq = iq + randint(1,20) print(f' your IQ has been raised to {iq}') print('Try again,one more time!') n1 = randint(1, 100) n2 = randint(1, 100) ans = int(input(f"{n1} + {n2} = ? ")) else: print(f'\nThe answer was {n1 + n2}.') print('Try One more time!') ans = int(input(f"{n1} + {n2} = ? ")) iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}') print('Try One more time!') n1 = randint(1, 100) n2 = randint(1, 100) ans = int(input(f"{n1} + {n2} = ? ")) if ans == n1 + n2: print('You got it!') print('\nNow for something harder:') iq = iq + randint(1,20) print(f' your IQ has been raised to {iq}') else: print(f'No, it was {n1 + n2}.') print('\nI give up.') iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}, idiot #{test}.') exit() elif dif == 2 and ion == 1: #3: Harder random addition n1 = randint(10, 1000) n2 = randint(10, 1000) ans = int(input(f"{n1} + {n2} = ? ")) if ans == n1 + n2: print('You got it!') iq = iq + randint(1,30) print(f' your IQ has been raised to {iq}') print('Try again,one more time!') n1 = randint(10, 1000) n2 = randint(10, 1000) ans = int(input(f"{n1} + {n2} = ? ")) else: print(f'Not quite! The answer was {n1 + n2}.') iq = iq - randint(1,30) print(f' your IQ has been lowered to {iq}') print('Try One more time!') n1 = randint(10, 1000) n2 = randint(10, 1000) ans = int(input(f"{n1} + {n2} = ? ")) if ans == n1 + n2: print('You got it!') iq = iq + randint(1,20) print(f' your IQ has been raised to {iq}') print('The program will end now.') else: print(f'Not quite! The answer was {n1 + n2}.') iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}') print('The program will end now.') n1 = randint(10, 10000) n2 = randint(10, 10000) ans = int(input(f"{n1} + {n2} = ? ")) if ans == n1 + n2: print('You got it!') iq = iq + randint(1,40) print(f' your IQ has been raised to {iq}') print('Try again,one more time!') n1 = randint(10, 10000) n2 = randint(10, 10000) ans = int(input(f"{n1} + {n2} = ? ")) else: print(f'Not quite! The answer was {n1 + n2}.') iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}') print('Try One more time!') n1 = randint(10, 10000) n2 = randint(10, 10000) ans = int(input(f"{n1} + {n2} = ? ")) if ans == n1 + n2: print('You got it!') iq = iq + randint(1,40) print(f' your IQ has been raised to {iq}') print('The program will end now.') else: print(f'Not quite! The answer was {n1 + n2}.') iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}') print('The program will end now.') elif dif == 3 and ion == 1: #4: Hardest random addition n1 = randint(10, 10000) n2 = randint(10, 10000) ans = int(input(f"{n1} + {n2} = ? ")) if ans == n1 + n2: print('You got it!') iq = iq + randint(1,40) print(f' your IQ has been raised to {iq}') print('Try again,one more time!') n1 = randint(10, 10000) n2 = randint(10, 10000) ans = int(input(f"{n1} + {n2} = ? ")) else: print(f'Not quite! The answer was {n1 + n2}.') iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}') print('Try One more time!') n1 = randint(10, 10000) n2 = randint(10, 10000) ans = int(input(f"{n1} + {n2} = ? ")) if ans == n1 + n2: print('You got it!') iq = iq + randint(1,40) print(f' your IQ has been raised to {iq}') print('Try again,one more time!') n1 = randint(10, 10000) n2 = randint(10, 10000) ans = int(input(f"{n1} + {n2} = ? ")) else: print(f'Not quite! The answer was {n1 + n2}.') iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}') print('Try One more time!') n1 = randint(10, 10000) n2 = randint(10, 10000) ans = int(input(f"{n1} + {n2} = ? ")) if ans == n1 + n2: print('You got it!') iq = iq + randint(1,40) print(f' your IQ has been raised to {iq}') print('Try again,one more time!') n1 = randint(10, 10000) n2 = randint(10, 10000) ans = int(input(f"{n1} + {n2} = ? ")) else: print(f'Not quite! The answer was {n1 + n2}.') iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}') print('Try One more time!') n1 = randint(10, 10000) n2 = randint(10, 10000) ans = int(input(f"{n1} + {n2} = ? ")) if ans == n1 + n2: print('You got it!') iq = iq + randint(1,40) print(f' your IQ has been raised to {iq}') print('The program will end now.') else: print(f'Not quite! The answer was {n1 + n2}.') iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}') print('The program will end now.') #5: Easy random subtraction if dif == 1 and ion == 2: n1 = randint(50, 100) n2 = randint(1, 50) ans = int(input(f"{n1} - {n2} = ? ")) if ans == n1 - n2: print('You got it.') iq = iq + randint(1,20) print(f' your IQ has been raised to {iq}') n1 = randint(50, 100) n2 = randint(1, 50) ans = int(input(f"{n1} - {n2} = ? ")) else: print(f'Not quite! The answer was {n1 - n2}.') print('Try again!') n1 = randint(50, 100) n2 = randint(1, 50) ans = int(input(f"{n1} - {n2} = ? ")) iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}') if ans == n1 - n2: print('You got it!') iq = iq + randint(1,20) print(f' your IQ has been raised to {iq}') print('Try again,one more time!') n1 = randint(50, 100) n2 = randint(1, 50) ans = int(input(f"{n1} - {n2} = ? ")) else: print(f'\nThe answer was {n1 - n2}.') print('Try One more time!') ans = int(input(f"{n1} - {n2} = ? ")) iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}') print('Try One more time!') n1 = randint(50, 100) n2 = randint(1, 50) ans = int(input(f"{n1} - {n2} = ? ")) if ans == n1 - n2: print('You got it!') print('\that was the last question!') iq = iq + randint(1,20) print(f' your IQ has been raised to {iq}') else: print(f'No, it was {n1 - n2}.') print('\nI give up.') iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}, idiot #{test}.') exit() elif dif == 2 and ion == 2: #6: Harder random subtraction n1 = randint(500, 1000) n2 = randint(10, 500) ans = int(input(f"{n1} - {n2} = ? ")) if ans == n1 - n2: print('You got it!') iq = iq + randint(1,30) print(f' your IQ has been raised to {iq}') print('Try again,one more time!') n1 = randint(500, 1000) n2 = randint(10, 500) ans = int(input(f"{n1} - {n2} = ? ")) else: print(f'Not quite! The answer was {n1 - n2}.') iq = iq - randint(1,30) print(f' your IQ has been lowered to {iq}') print('Try One more time!') n1 = randint(500, 1000) n2 = randint(10, 500) ans = int(input(f"{n1} - {n2} = ? ")) if ans == n1 - n2: print('You got it!') iq = iq + randint(1,20) print(f' your IQ has been raised to {iq}') print('The program will end now.') else: print(f'Not quite! The answer was {n1 + n2}.') iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}') print('The program will end now.') n1 = randint(500, 1000) n2 = randint(10, 500) ans = int(input(f"{n1} - {n2} = ? ")) if ans == n1 - n2: print('You got it!') iq = iq + randint(1,30) print(f' your IQ has been raised to {iq}') print('Try again,one more time!') n1 = randint(500, 1000) n2 = randint(10, 500) ans = int(input(f"{n1} - {n2} = ? ")) else: print(f'Not quite! The answer was {n1 - n2}.') iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}') print('Try One more time!') n1 = randint(500, 1000) n2 = randint(10, 500) ans = int(input(f"{n1} + {n2} = ? ")) if ans == n1 - n2: print('You got it!') iq = iq + randint(1,30) print(f' your IQ has been raised to {iq}') print('The program will end now.') else: print(f'Not quite! The answer was {n1 + n2}.') iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}') print('The program will end now.') elif dif == 3 and ion == 2: #4: Hardest random subtraction n1 = randint(5000, 10000) n2 = randint(10, 5000) ans = int(input(f"{n1} - {n2} = ? ")) if ans == n1 - n2: print('You got it!') iq = iq + randint(1,40) print(f' your IQ has been raised to {iq}') print('Try again,one more time!') n1 = randint(5000, 10000) n2 = randint(10, 5000) ans = int(input(f"{n1} - {n2} = ? ")) else: print(f'Not quite! The answer was {n1 - n2}.') iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}') print('Try One more time!') n1 = randint(5000, 10000) n2 = randint(10, 5000) ans = int(input(f"{n1} - {n2} = ? ")) if ans == n1 - n2: print('You got it!') iq = iq + randint(1,40) print(f' your IQ has been raised to {iq}') print('Try again,one more time!') n1 = randint(5000, 10000) n2 = randint(10, 5000) ans = int(input(f"{n1} - {n2} = ? ")) else: print(f'Not quite! The answer was {n1 - n2}.') iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}') print('Try One more time!') n1 = randint(5000, 10000) n2 = randint(10, 5000) ans = int(input(f"{n1} - {n2} = ? ")) if ans == n1 - n2: print('You got it!') iq = iq + randint(1,40) print(f' your IQ has been raised to {iq}') print('Try again,one more time!') n1 = randint(5000, 10000) n2 = randint(10, 5000) ans = int(input(f"{n1} - {n2} = ? ")) else: print(f'Not quite! The answer was {n1 - n2}.') iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}') print('Try One more time!') n1 = randint(5000, 10000) n2 = randint(10, 5000) ans = int(input(f"{n1} - {n2} = ? ")) if ans == n1 - n2: print('You got it!') iq = iq + randint(1,40) print(f' your IQ has been raised to {iq}') else: print(f'incorrect. The answer was {n1 - n2}.') iq = iq - randint(1,20) print(f' your IQ has been lowered to {iq}')