Question: *Can you check this code* having problems while running it? import random def questions(): name=input(What is your name:) print(Hello there,name,!) choice = random.choice(+-x) finish =

*Can you check this code* having problems while running it?

import random

def questions(): name=input("What is your name:") print("Hello there",name,"!")

choice = random.choice("+-x") finish = False questionnumber = 0 correctquestions = 0

while finish == False: if questionnumber < 10 | questionnumber >= 0: number1 = random.randrange(1,10) number2 = random.randrange(1,10) print((number1),(choice),(number2)) answer=int(input("What is the answer?")) questionnumber = questionnumber + 1

if choice==("+"): realanswer = number1+number2 if answer==realanswer: print("That's the correct answer") correctquestions = correctquestions + 1 else: print("Wrong answer, the answer was",realanswer,"!")

if choice==("x"): realanswer = number1*number2 if answer==realanswer: print("That's the correct answer") correctquestions = correctquestions + 1 else: print("Wrong answer, the answer was",realanswer,"!")

elif choice==("-"): realanswer = number1-number2

if answer==realanswer: print("That's the correct answer") correctquestions = correctquestions + 1 else: print("Wrong answer, the answer was",realanswer,"!") else: finish = True else: print("Good job",name,"! You have finished the quiz")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!