1. 程式人生 > >python 密文輸入判斷

python 密文輸入判斷

# Author:hjl
import getpass
u_name = "a"
u_pwd = 5       #這是整型
name = input("name:")
pwd = getpass.getpass("password:")  #這是字元型
print(name,pwd)

if u_name == name and u_pwd == int(pwd):    #比較時要轉成同類型的
    print("yes")
else:
    print("no")