【发布时间】:2021-08-19 18:01:56
【问题描述】:
print("The mangy, scrawny stray dog %s gobbled down" +
"the grain-free, organic dog food." %'hurriedly')
上面的语句给了我错误“TypeError : not all arguments convert during string formatting”。
任何帮助将不胜感激。
【问题讨论】:
-
删除字符串文字之间的
+。+的优先级低于%,并且相邻的字符串文字无论如何都会连接起来。
标签: python python-3.x string printing typeerror