循环用户输入Python

2024-09-24 06:29:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我想循环输入,得到3个猜测,或2个猜测和1条线索:

if chosen == 1:
    print ("Your anagram is:", anagrameasy)
time.sleep(1)
easyguess = input ("Please input the answer in lower case, type clue for a clue")

if easyguess == answereasy:
    print ("correct")

     if easyguess == "clue":
        print (clueeasy)
        easyguess = input ("Please input the answer in lower case, type clue for a clue")

     elif easyguess != answereasy:
         print("try again")

Tags: theanswerinforinputiftypelower