IDLE告诉我,continue函数已退出循环

时间:2019-02-01 02:40:27

标签: python python-3.x error-handling

当尝试运行我的程序时,我收到继续函数退出循环的错误。

检查语法后,我不知道出了什么问题,并且在尝试缩进时,由于缩进过多而出现错误。

while True:
    print('What is your username')
    name = input()
    if name != 'Banana': # Username doesn't have to be equal to
        continue # If the username is correct they will pass on the next question
    print('Hello, Banana. What is the password? (It is a dog') # How would I put a real hint 
    password = input() # Input password
    if password == 'AkitadaMonsta':
        break # They don't have to start over again
    print('Access granted.') # Allowing them in

0 个答案:

没有答案