Answered step by step
Verified Expert Solution
Question
1 Approved Answer
[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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started