+ 1
print spacing with {:23}
name = "Gordon" response ="My name is {}".format(name) print("{:23}".format(response)) Why {:23} fails to spacing?🤔
2 Antworten
+ 1
It is spaced, but with left alignment. So you probably didn't notice. Try
name = "Gordon"
response ="My name is {}".format(name)
print("{:23} Chan.".format(response))
If you want right alignment, use {:>23}
+ 2
😲It works! Now I can help the others out~ 😆