gpt4 book ai didi

Python创建用户名密码程序

转载 作者:太空宇宙 更新时间:2023-11-03 12:37:06 25 4
gpt4 key购买 nike

<分区>

我现在只是一个初级程序员,我正在尝试创建一个用户名/密码程序。下面是我的代码:

username = 'Polly1220'

password = 'Bob'

userInput = input("What is your username?\n")

if userInput == username:
a=input("Password?\n")
if a == password:
print("Welcome!")
else:
print("That is the wrong password.")
else:
print("That is the wrong username.")

每当我运行我的程序并如图所示输入正确的密码时,它总是说密码不正确。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com