Python在字符串種嵌入值怎么實現(xiàn)?
提問人:楊紫紅發(fā)布時間: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ù)查找其他問題的答案?
相關視頻回答
點擊加載更多評論>>