DBILITY

python string placeholder? formatting 본문

python

python string placeholder? formatting

DBILITY 2021. 8. 17. 12:38
반응형

가장 편한 것은 3.6이상에서 지원하는 세번째겠다.

>>> name = 'bean'
>>> print('My Name is %s'%name)
My Name is bean
>>> print('My Name is {}'.format(name))
My Name is bean
#3.6 over
>>> print(f'My Name is {name}')
My Name is bean

 

반응형
Comments