+ 2
How to Print 2 Formatted Variable ?
i=45 j=300 print ("%4d %6d" %i %j) This code produces error. How to fix it?
2 Answers
+ 5
i=45
j=300
print('%4d %6d' %( i, j))
but really, use f-strings...
print(f'{i:4} {j:6}')
+ 2
Tq Bob_Li đ
i=45 j=300 print ("%4d %6d" %i %j) This code produces error. How to fix it?