立即学习:https://edu.csdn.net/course/play/26755/340116?utm_source=blogtoedu
1.格式化整数:
n=1234
a=format(n,'0>10d')#0代表要补的东西,>右对齐,<左对齐
a=0000001234
2.格式化浮点数:
a=30.1
b=format(a,'0.2f')
b=30.10
立即学习:https://edu.csdn.net/course/play/26755/340116?utm_source=blogtoedu
1.格式化整数:
n=1234
a=format(n,'0>10d')#0代表要补的东西,>右对齐,<左对齐
a=0000001234
2.格式化浮点数:
a=30.1
b=format(a,'0.2f')
b=30.10