1.输入使用input
username = input("username:") password = input("password:") print(username,password)
2.输入打印出格式
name = input("name:") age = input("age:") job = input("job:") info =‘‘‘_____info of %s____ name:%s age:%s job:%s ‘‘‘ %(name,name,age,job) print(info)
name = input("name:") age = input("age:") job = input("job:") info =‘‘‘_____info of name____ name:name age:age job:job ‘‘‘ .format(name=name,age=age,job=job) print(info)
3.密码输入密文模块
import getpass username = input("username:") password = getpass.getpass("password:") print(username,password)
原文地址:https://www.cnblogs.com/heyue13/p/12336316.html
时间: 2024-10-11 14:12:28