Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 1
print spacing with {:23}
name = "Gordon" response ="My name is {}".format(name) print("{:23}".format(response)) Why {:23} fails to spacing?š¤
2 Respostas
+ 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~ š