解决python中TypeError: not enough arguments for format string

解决python中TypeError: not enough arguments for format string

格式化字符串时,%后面的内容要用小括号括起来

# right
print('I and %s and % and %s' % (people1,people2,people3))
# wrong
print('I and %s and % and %s' % people1,people2,people3)

参考文献:https://blog.csdn.net/w926498/article/details/80579520

posted on 2022-04-09 13:04  coderabcd  阅读(782)  评论(0)    收藏  举报

导航