ID = "jiyeon"
password = "1004"


user_ID = input("아이디를 입력하세요: ")

if user_ID == ID:
    for chance in range(3, 0, -1):     #3, 2, 1로 반복
        print(f"로그인 시도 남은 횟수 :  {chance} ")
        
        user_password = input("비밀번호를 입력하세요: \n")
    
        if user_password == password:
            print("로그인 성공!")
            break   #조건문을 종료한다!
        else:
            print("로그인 실패!\n")
            if chance == 1:
                print("3회 모두 실패했으니, 계정 잠겼음!!!!!")
            else:
                print("다시 시도해 보세요!!!")
else:
    print("등록되지 않은 아이디입니다! 다시 아이디를 입력하세요!")

    

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: