Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
import random def ask _ position _ question ( ) : planet = random.choice ( planets ) position = planets.index ( planet ) + 3
import random def askpositionquestion: planet random.choiceplanets position planets.indexplanet userresponse inputfWhat is the position of planet relative to the Sun? if userresponse.isdigit and intuserresponse position: printfThat is correct. planet is planet number position from the Sun." else: userguess inputfThat is not correct. planet is planet number position from the Sun." userguess inputWhat is the name of the strposition th planet from the sun? if userguess planet: printThat is correct. Next question, BRO" else: printThat is not correct. Next question." askpositionquestionimport random def askpositionquestion: planet random.choiceplanets position planets.indexplanet userresponse inputfWhat is the position of planet relative to the Sun? if userresponse.isdigit and intuserresponse position: printfThat is correct. planet is planet number position from the Sun." else: userguess inputfThat is not correct. planet is planet number position from the Sun." userguess inputWhat is the name of the strposition th planet from the sun? if userguess planet: printThat is correct. Next question, BRO" else: printThat is not correct. Next question." askpositionquestion
import random
def askpositionquestion:
planet random.choiceplanets
position planets.indexplanet
userresponse inputfWhat is the position of planet relative to the Sun?
if userresponse.isdigit and intuserresponse position:
printfThat is correct.
planet is planet number position from the Sun."
else:
userguess inputfThat is not correct.
planet is planet number position from the Sun."
userguess inputWhat is the name of the strposition th planet from the sun?
if userguess planet:
printThat is correct. Next question, BRO"
else:
printThat is not correct. Next question."
askpositionquestionimport random
def askpositionquestion:
planet random.choiceplanets
position planets.indexplanet
userresponse inputfWhat is the position of planet relative to the Sun?
if userresponse.isdigit and intuserresponse position:
printfThat is correct.
planet is planet number position from the Sun."
else:
userguess inputfThat is not correct.
planet is planet number position from the Sun."
userguess inputWhat is the name of the strposition th planet from the sun?
if userguess planet:
printThat is correct. Next question, BRO"
else:
printThat is not correct. Next question."
askpositionquestion
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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