1. 程式人生 > >Python學習之路Day1:passwd

Python學習之路Day1:passwd

col == import password print pre 判斷 day python

加密密碼:

import getpass
username = input("username:")
password = getpass.getpass("password:")
print(username,password)

用戶名和密碼判斷:
_username = ‘alex‘
_password =‘abc123‘
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!")
----------------------------------------------------------
技術分享

Python學習之路Day1:passwd