python格式化字符串 转义%

格式化字符串时,如果字符中包含%,需要用%对%进行转义,即%%

>>> a= "%%%s%%"%("abc")
>>> a
'%abc%'

posted @ 2020-05-13 17:20  sunshine_5  阅读(2953)  评论(0编辑  收藏  举报