问答详情
源自:3-7 Python的字符串format

字符串format任务

# Enter a code

testFormat="Life is {1}, you need {0}"

result1=testFormat.format("Python","short")


print(result1)


testFormat="Life is {s}, you need {p}"


s="short"

p="Python"


result2=testFormat.format(p=p,s=s)


print(result2)


提问者:qq_林林小小_0 2021-05-28 11:14

个回答

  • 子夜十分
    2021-05-31 21:51:36

    Lift is short,you need Python

    Lift is short,you need Python