如何在python中重複函數。如Repeat ... Unil用其他語言。謝謝,這是我想重複的代碼:在Python中重複函數
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
任何幫助將不勝感激!
多少次?你爲什麼不穀歌? –
Python支持'for'和'while' –
不完全清楚你想要做什麼 – sloth