Python 문자열 format()

Jmnote (토론 | 기여)님의 2020년 2월 8일 (토) 10:55 판 (→‎같이 보기)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요[ | ]

Python 문자열 format()

2 예제[ | ]

Python
CPU
0.0s
MEM
8M
0.1s
Copy
print("a","b","c","d","e")
print("{} {} {} {} {}".format("a","b","c","d","e"))
a b c d e
a b c d e

3 {자료형}.format(인수)[ | ]

Python
CPU
0.0s
MEM
8M
0.0s
Copy
age=2; name = 'ZETAWIKI'
print("The {0} is {1} years old.".format(name,age))
The ZETAWIKI is 2 years old.

4 같이 보기[ | ]