Programming/Python
python print - sep, end
Chan_찬
2020. 7. 2. 12:47
반응형

python print
print 문 sep
, end
옵션 사용법
list_s = ['a','b','c']
print(list_s)
>>> ['a','b','c']
print(*list_s)
>>> a b c
# sep: print 출력문 사이에 해당 내용을 넣을 수 있다
# default: seq=' '
print(*list_s, sep='__')
>>> a__b__c
print(*list_s, sep='')
>>> abc
# end: print 출력문 마지막에 해당 내용을 넣을 수 있다
# default: end='\n'
print(*list_s, end='__')
>>> a b c__
728x90
반응형
BIG