首页 > 代码库 > python Day02

python Day02

交互式输入,判断用户名密码是否匹配

 

#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author Jean

import getpass

users = "jean"
passd = "123456"

username = input("username: ")
#password = input("password: ")
password = getpass.getpass("password: ")

if username == users and password == passd:
print("Welcome {name} login..".format(name=username))
else:
print("Invliad user or password..")

python Day02