the_count = [001, 002, 003, 004, 005]
for number in the_count:
print(number)
输出是:
1
2
3
4
5
我的预期输出是:
001
002
003
004
005
最佳答案
print('{0:03d}'.format(number))
或者看看 zfill 或 rjust
关于python - 我想打印与列表中指定的相同的整数值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36690398/