Python
format함수 공부중 궁금한것
s9="this is {0:<10} | done{1:<5}".format('left', 'a')
s10="this is {0:>10} | done{1:>5}".format('right','b')
s11="this is {0:^10} | done{1:^5}".format('center','c')

print(s9,'\n',s10,'\n',s11)

지금 format 함수를 연습하고 있는데 결과가 

this is left       | donea     
 this is      right | done    b 
 this is   center   | done  c  

이렇게 나왔습니다. 

결과에서 두번째, 세번째줄은 왜 처음 한칸이 띄어져 있는 건가요? 

 

댓글 1