My program currently looks like this:
import random
answer = ""
correct_math = ["2", "3", "1"]
math_problems = ["What is the square root of 25? 1.) 4 2.) 5 3.) 6: ", "What is 97 + 113? 1.) 200 2.) 100 3.) 210: ", "What is 954 - 164? 1.) 790 2.) 835 3.) 756: "]
answer = input("STUDY GUIDE: What subject are you trying to study? Math (1) Science (2) History (3) : ")
if answer == "1":
answer = input(random.choice(math_problems))
I'm trying to make it so it calls a random question to study but I don't know how to make it so that the question randomly that it calls will equal the answer in the answer list. I have them set up 1:1 so the first item in the problem list is answered in the correctmath
list in order. I just need to know how to call the correct answer pertained to the question randomly pulled if that makes sense. Also my code isn't spaced out like that it just wouldn't let me add new paragraphs.