为了账号安全,请及时绑定邮箱和手机立即绑定

字符串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)


正在回答

1 回答

Lift is short,you need Python

Lift is short,you need Python

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

字符串format任务

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信