2017-10-13 101 views

回答

3

的字段中包含的+字符,它需要被佔的寬度。你想你的領域是字符寬:

print("T%+03d" % hour) 

演示:

>>> hour = 2 
>>> print("T%+03d" % hour) 
T+02 
相關問題