-2
나는 다음과 같은 코드를 가지고 있지만 else
지점이 작동하지 않습니다그렇지 지점이 실행되지 않습니다
def main():
while True:
username = input ("Enter Username: ")
password = input ("Enter Password: ")
if username == 'Filip' and password == 'XD' or "Miroslav" and "plusko12":
import time
time.sleep(1)
print ("Login successful!")
logged()
else:
print("STOP")
def logged():
import time
time.sleep(1)
print ("Welcome to the Server")
#Booting now
print("Booting will begin shortly")
import time
time.sleep(3)
print("Starting.................0%")
# ... and there's more stuff in here
quit(0)
main()
이 문맥에서 "작동하지 않는다"는 의미는 무엇입니까? 그런데'if (username == 'Filip'과 password == 'XD') 또는 (username == "Miroslav"와 password == "plusko12") :' –
' XD ','Miroslav ','plusko12 '}'? –
들여 쓰기도 잘못되었다고 생각합니다.'if'가'while' 안에 있어야한다고 생각합니다. – MSeifert