input函数默认传递的参数是字符型;%s获取变量值

#!/usr/bin/env python
# _*_ coding:utf-8 _*_
name = input("input your name:")
age  = int(input("input your age :"))  # python3.0里input函数默认传递的是字符型
job  = input("input your job :")
msg= """
Information of user %s   # %s,%d,%f用于获取变量值
------------------------------
Name = %s
Age  = %d
Job  = %s
------------------------------
"""%(name,name,age,job)
print(msg)

你可能感兴趣的:(input函数默认传递的参数是字符型;%s获取变量值)