Python 格式化输出
2021-05-05 01:30
标签:you auth put input class int pre python code Python 格式化输出 标签:you auth put input class int pre python code 原文地址:https://www.cnblogs.com/andysongtech/p/13193501.html 1 #!/usr/bin/env python
2 # Author: Andy Song
3 # date: 2020/6/25
4 # 占位符: %s: string, %d: digit, %f: float
5
6 name = input("Your Name Is: ")
7 gender = input("Your Gender Is: ")
8 age = int(input("Your Age Is: "))
9 job = input("Your Job Is: ")
10 ID = int(input("Your ID Is: "))
11
12
13 msg = ‘‘‘
14
15 ------------------- Info of %s ---------------------
16
17 Name: %s
18 Gender: %s
19 Age: %d
20 Job: %s
21 ID: %d
22
23 ------------------- End -----------------------------
24
25 ‘‘‘ %(name, name, gender, age, job, ID)
26
27 print(msg)
上一篇:Spring面试题及答案
下一篇:我的python菜鸟之路7