标签:pytho image int 信息 http 拼接 for png job
#%s是点位符 s--string
name = input("name:")
age = input("age:")
job = input("job:")
salary = input("salary:")
info=‘‘‘
-----info of0‘‘‘+name +‘‘‘----
Name:‘‘‘+name+‘‘‘
Age:‘‘‘+age+‘‘‘
Job:‘‘‘+job+‘‘‘
Salary:‘‘‘+salary
print(info)
name = input("name:")
age = int (input("age:"))
print(type(age))
#print(type(age),type(str(age))) 再转换成str
job = input("job:")
salary = input("salary:")
info1=‘‘‘
-----info of1 %s----
Name:%s
Age:%d
Job:%s
Salary:%s
‘‘‘ % (name,name,age ,job,salary)
print(info1)
info2=‘‘‘
-----info of2 {_name}----
Name:{_name}
Age:{_age}
Job:{_job}
Salary:{_salary}
‘‘‘.format (_name=name,_age=age,_job=job,_salary=salary)
print(info2)
info3=‘‘‘
-----info of3 {0}----
Name:{0}
Age:{1}
Job:{2}
Salary:{3}
‘‘‘.format (name,age,job,salary)
print(info3)
运行结果:
标签:pytho image int 信息 http 拼接 for png job
原文地址:https://www.cnblogs.com/morningdaylight/p/9969821.html