位置:首頁 > 軟件操作教程 > 編程開發(fā) > Python > 問題詳情

Python在字符串種嵌入值怎么實(shí)現(xiàn)?

提問人:楊紫紅發(fā)布時(shí)間:2020-11-18

>>> myscore = 1000

>>> message = 'I scored %s points'

>>> print(message % myscore)

I scored 1000 points


>>> nums = 'What did the number %s say to the number %s? Nice belt!!'

>>> print(nums % (0, 8))

What did the number 0 say to the number 8? Nice belt!!


繼續(xù)查找其他問題的答案?

相關(guān)視頻回答
回復(fù)(0)
返回頂部