Python에서 문자열 대입하기


"I have %s apples" %3
==> I have 3 apples

"Error is %d%%."%98
==> Error is 98%

"I eat {0} apples".format(3)
==> I eat 3 apples

반응형

+ Recent posts