print function
1. Separator Option
print('010', '1234', '5678', sep='-')
2. End Option
print('Welcome to', end=' ')
print('IT News', end=' ')
print('Web Site')
3. File Option
print('Learn Python', file='~~~')
print('Art: %5d, Price per Unit: %8.2f' % (453, 59.058))
print('Art: {0:5d}, Price per Unit: {1:8.2f}'.format(453, 59.058))
print('Art: {a:5d}, Price per Unit: {p:8.2f}'.format(a=453, p=59.058))
price = 11.23
print(f'Price in Euro: {price}')
print(f'Price in Swiss Franks: {price * 1.086:5.2f}')
for article in ["bread", "butter", "tea"]:
print(f"{article:>10}:")
'{:>10}'.format('nice')
'{:_>10}'.format('nice')
'{:^10}'.format('nice')
'{:.2}'.format('nice')
'{:10.2}'.format('nice')
'{:1.18f}'.format(3.141592653589793)
'{:06.2f}'.format(3.141592653589793)
s = 'Python'
s.center(10)
s.center(10,"*")
s = 'Training'
s.ljust(12)
s = 'Programming'
s.rjust(15)
account_number = '43447879'
account_number.zfill(12)
참고