# -*- coding:utf-8 -*- # Auther:Leon import getpass user=input("請輸入帳號:") pwd=getpass.getpass("請輸入密碼:") if user == "leon" and pwd == "leon" : print("logs-in successfully") else: print("Username or Password NG")
ps:python
Python實現星號遮掩的密碼輸入參考:http://blog.csdn.net/sbdxxcjh/article/details/39120095ide