How do I repeat a function in python. Such as Repeat... Unil in other languages. Thanks, this is the code I'm trying to repeat:
import random
line = random.choice(keywords)
print('Keyword:')
print (line)
line = random.choice(definitions)
print ('A:')
print (line)
line = random.choice(definitions)
print ('B:')
print(line)
line = random.choice(definitions)
print ('C:')
print(line)
#randomly selects a keyword and definition from the file
A = []
ans = input('Is it A, B or C?')
print()
if ans == 'A' :
print ('Correct')
else:
print ('Incorrect')
#asks the user for an answer, then tells them if their correct or not
Any help would be much appreciated!