📜  f字符串在python代码示例前加0

📅  最后修改于: 2022-03-11 14:45:09.761000             🧑  作者: Mango

代码示例1
import random
for i in  [25,300,478,2,1000]:
  print(f"{i:04d}")
# output: 0025 0300 0478 0002 1000