使用Python字符串格式化格式化與運營商的錯誤,我的預期成果是:字符串在python
If you took 19 and 13 and added them, you would get 22
但不是很確定如果我有得當的。我一直得到這個錯誤:
Not all arguments converted during string formatting
你能幫忙嗎?
代碼:
my_age = 19
teenager = 13
print "If you took %s and %s and added them, then you will get %" %(my_age,teenager,my_age + teenager)
你最後'%後失蹤的說明符'。您需要:'「get%d」' –