第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

第二行那里不知道怎么錯了

template = 'L{0} i{1} s{2},y{3} n{4} P{5}'

0 = 'ife'

1 = 's'

2 = 'hort'

3 = 'ou'

4 = 'eed'

5 = 'ython'

result =? template.format(0 = ife , 1 = s , 2 = hort , 3 = ou , 4 = eed , 5 = ython)

print(result)


正在回答

1 回答

變量不能以數(shù)字開頭,所以'0''1'……這些數(shù)字不能作為變量,改成這樣就可以了:

template = 'L{a0} i{a1} s{a2},y{a3} n{a4} P{a5}'

a0 = 'ife'

a1 = 's'

a2 = 'hort'

a3 = 'ou'

a4 = 'eed'

a5 = 'ython'

result =? template.format(a0 = 'ife' , a1 = 's' , a2 = 'hort' , a3 = 'ou' , a4 = 'eed' , a5 = 'ython')

print(result)

或者不單獨定義變量也可以:

template = 'L{0} i{1} s{2},y{3} n{4} P{5}'

result =? template.format('ife','s','hort','ou','eed','ython')

print(result)


下載視頻 ? ? ? ? ?
0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

第二行那里不知道怎么錯了

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號