Question: 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
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
