I am an APCSP student in high school and one of our open-ended assignments is to create a program that has an educational function. Here is the specific Python function I'll be calling in the main program:
def worldStudyQuestions():
worldStudying = True
while worldStudying:
print ("Thanks for studying world history!")
print ("This study guide consists of ten questions about ancient religions. \n")
w1 = "Which religion focused on the preservation of all natural things?"
w1Ans = "Jainism required adherents to move slowly so as to not kill souls living in different objects."
w2 = "Was the Roman state religion monotheistic or polytheistic?"
w2Ans = "Polytheistic; they based their gods on the Greek gods."
w3 = "What was the Buddha's original name?"
w3Ans = "Siddhartha Gautama"
w4 = "Which Greek cult often fled to the mountains to drink wine?"
w4Ans = "Cult of Dionysus"
w5 = "How many tribes of Israel existed?"
w5Ans = "Twelve"
w6 = "Did Confucians look up to a god?"
w6Ans = "No, they were primarily philosophical."
w7 = "Where did Gabriel first make contact with Muhammad?"
w7Ans = "In a cave near Mecca."
w8 = "What attracted the lower classes to Hinduism?"
w8Ans = "Hinduism disregarded the traditional caste system of imperial India."
w9 = ""
w9Ans = ""
w0 = ""
w0Ans = ""
worldQuestionList = [w1, w2, w3, w4, w5, w6, w7, w8, w9, w0]
worldAnsList = [w1Ans, w2Ans, w3Ans, w4Ans, w5Ans, w6Ans, w7Ans, w8Ans, w9Ans, w0Ans]
print ("Question 1:", random.choice(worldQuestionList))
worldStudying = False
Say random.choice selects w5 from worldQuestionList, I'd like w5Ans to be displayed when the user enters an empty string and then have w5 be removed from the randomization process on the next iteration. How do I achieve this?