Python learn first week

A, pycharm installation

https://www.cnblogs.com/dcpeng/p/9031405.html

Second, the code Contact

1, input-output (plain text):

  username = input("usrname:")

       password = input("password:")

  print(username,password)

2, input and output (ciphertext):

 

When import getpass ## type are not displayed input character

 

 

 

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

 

3, enter the account password verification is correct:

 

_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!")

 

Guess you like

Origin www.cnblogs.com/hapen66/p/10963023.html