Nov-13-2020, 10:49 AM
Hello everyone,
I need to find out how to see if the users answer is correct. In this, the answers are randomly generated and the user has to input an answer and the program will check if it is correct or nott.Could someone please help, i will input my existing code.
I need to find out how to see if the users answer is correct. In this, the answers are randomly generated and the user has to input an answer and the program will check if it is correct or nott.Could someone please help, i will input my existing code.
import random print('Random number generator') lowest_option= int(input('What is the lowest option? ')) highest_option= int(input('What is the highest option? ')) counter = 0 for count in range(5): limit1 = random.randint(lowest_option, highest_option) limit2 = random.randint (lowest_option, highest_option) player_answer = int(input('What is the answer to' + str(limit1) + '+' + str(limit2) + ' ?'))