print('%s %s %s' % ('a','b','c'))
# a,b,c
print('%s %d %s' % ('a',1,'c'))
# a 1 c
print('%s %f %s' % ('a',1.111,'c'))
# a 1.111000 c
print('{0} {1} {2}'.format('a','b','c'))
# a b c
print('{0} {1} {2}'.format('a',1,'c'))
# a 1 c
print('{0} {1} {2}'.format('a',1.111,'c'))
# a 1.111 c
pyfiddle : https://pyfiddle.io/fiddle/59d69f15-7723-4e55-8244-c4a8078dd322/?i=true
more format : https://pyformat.info/
'Web_Application > python' 카테고리의 다른 글
visual studio code configured debug type 'python' is not supported (0) | 2019.09.03 |
---|---|
python md5 사용법 (0) | 2019.06.29 |
[python][mssql] query module, example (0) | 2019.05.16 |
[python][win10] scrapy install error (0) | 2019.04.23 |
[python][ubuntu] scrapy install error - setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 (0) | 2019.04.23 |