交互式输入,判断用户名密码是否匹配
#!/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..")
时间: 2024-10-11 04:54:21