Question: [Using Python] Create a program to generate one random question, from a list of 8, for each repeated run. Report the number of the correct

[Using Python] Create a program to generate one random question, from a list of 8, for each repeated run. Report the number of the correct answers after all 8 questions have been answered

Your 8 questions should be a simple math problem, like "what is 5-2?"

  • use a while loop based on the number of questions
    • use a counter variable to count the number of questions asked
    • e.g. question_count +=1
  • user a counter variable to keep track of the correct answers
    • e.g. correct_count +=1
  • for the questions, generate random numbers between 0 and 9
    • e.g. random_number = random.randint(0, 9)
    • you will need "import random" as the first line in your program
  • all questions should be larger number - smaller number
    • i.e. so if the first generated number is 1 and the second 2
    • your question should be 2-1 (not 1-2)

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!