接触Python的第一天,数据类型、语法方式、判断、循环
整体上是比较简洁
感谢老男孩的视频教程
写一个简单的判断
Login.py
import getpass
username="stone"
password="112233"
for i in range(3):
_username=input("Username:")
_password = input("Password:")
#_password=getpass.getpass("Password:")
if _username==username and _password==password:
print("Welcome",username)
break
else:
print("username or password error,please try agin")
else:
print("you try too many times,bye...")
时间: 2024-11-06 12:23:46