#密文密码
1 import getpass 2 password = getpass.getpass("passwd:")
#If——else
1 user = 'gdr' 2 pass_wd = '123456' 3 4 username = input("username:") 5 password = input("password:") 6 7 if user == username and pass_wd == password: 8 print("%s login!!" % username) 9 else: 10 print("Wrong username or password!!")
#猜数字练习题
guess_number = int(22) get_number = int(input('Please enter the number you guessed>>>')) if guess_number == get_number: print("Congratulations, you guessed it") elif guess_number > get_number: print("The number you guessed is too small") else: print("The number you guessed is too big")