我都不知道该怎么解释。在
Question1 = "a"
Question2 = "b"
Question3 = "c"
Question4 = "d"
Question5 = "e"
等等
^{pr2}$等等
questioninteger = random.randint(1,20)
if(questioninteger == 1):
Boolean1 = True
Question == Question1
Answer == Answer1
FlashCard()
if(questioninteger == 2):
Boolean2 = True
Question == Question2
Answer == Answer2
FlashCard()
if(questioninteger == 3):
Boolean3 = True
Question == Question3
Answer == Answer3
FlashCard()
等等
print("")
print(Question)
print("")
key = raw_input()
if(key == Answer):
print("Correct!")
time.sleep(1)
QuestionPicker()
(均在功能范围内)
问题是Python不会改变变量问题,而且不会出现错误答案被成功地改变了,“问题”就不会了。在
全局变量通常是个坏主意;最好将代码重写为
相关问题 更多 >
编程相关推荐