#rjust () ljust ()
from spam = 'Hello'
Print (spam.rjust (20, '*')) with a length of 20 right justified # '*' filled with
print (spam.ljust (10, '. ')) # Left aligned with the length 10 '' filled with
print (spam.center (15, '= ')) # 15 with play to its length '=' filled
python align text
Guess you like
Origin www.cnblogs.com/shunguo/p/11441636.html
Recommended
Ranking