So i have a recent python project and i'm struggling a little, if anyone could be of any assistance that would be great :). The project is to make a 'Flash Cards' type quiz within which i am required to make a random generator to import one randomly chosen keyword with three randomly selected definitions containing one correct answer. If they select the correct answer then a success message is displayed, after every keyword is done twice the program will end. I thaught i could make a tickoff for each time a keyword is presented but the whole random generator has got me confuzed. Would be awesome if anyone could help me or at least point me in the right direction.:D
So far this is something i've thaught of :s
import random
name = input("What is your name? ")
in_file = open("keywords.txt", "rt")
Q1_tickoff = 2
Q2_tickoff = 2
Q3_tickoff = 2
Q4_tickoff = 2
Q5_tickoff = 2
Q6_tickoff = 2
Q7_tickoff = 2
Q8_tickoff = 2
Q9_tickoff = 2
Q10_tickoff = 2
print("Hey there, this is a 'Flash Cards' quiz. So, Ready " + name + "? Here comes the first question :)")
T = True
while T == True:
randomQ = random.randint(0,15)