python 字串輸出格式語法小細節

'img width: %s, img height: %s' % 100, 100
這樣不行(TypeError: not enough arguments for format string)

要這樣才行
'img width: %s, img height: %s' % (100, 100)
也就是說後方輸入的向量維度要對

留言

熱門文章