python基础:输密码
#输入密码不显示(隐藏)
import getpass
username = input("username:")
password = getpass.getpass("password:")
print(username,password)
#判断用户名和密码是否输入正确
_username = 'alex'
_password = '123456'
username = input("username:")
password =input("password:")
if _username == username and _password == password:
print("Welcome user {name} login...".format(name=username) )
else:
print("Invalid username or password!")