标签:code title class col 方式 name print 打印 input
输入并打印个人信息的三种方式:
name = input("name:") age = input(‘age:‘) job = input("job:") title = input("title:") info = ‘‘‘ ---info of %s--- name:%s age:%s job:%s title:%s ‘‘‘ % (name, name, age, job, title) print(info) info2 = ‘‘‘ ---info of {_name} name:{_name} age:{_age} job:{_job} title:{_title} ‘‘‘.format(_name=name, _age=age, _job=job, _title=title) print(info2) info3=‘‘‘ ---info of {0}--- Name={0} Age={1} Job={2} Title={3} ‘‘‘.format(name,age,job,title) print(info3)
标签:code title class col 方式 name print 打印 input
原文地址:https://www.cnblogs.com/spencersun/p/9065853.html