哪有什么岁月静好,不过是有人替你负重前行!

python 打印好看的个人信息卡

name = input('name:')
age = input('age:')
hometown = input('hometown:')
hobbie = input('hobbie:')

msg = f'''
---------- info of {name} ----------
Name      : {name}
Age       : {age}
Hometown  : {hometown}
Hobbie    : {hobbie}
------------- end ------------------
'''

print(msg)

 执行结果为:

name:lgonfei
age:28
hometown:河南
hobbie:money,girl

---------- info of lgonfei ----------
Name      : lgonfei
Age       : 28
Hometown  : 河南
Hobbie    : money,girl
------------- end ------------------

  

posted @ 2021-11-02 10:42  longfei825  阅读(92)  评论(0编辑  收藏  举报