我有这个将字符串添加到整数的 python 程序:
a = raw_input("Enter a: ")
b = raw_input("Enter b: ")
print "a + b as strings: " + a + b
a = int(a)
b = int(b)
c = a + b
str(c)
print "a + b as integers: " + c
我收到此错误:
Python: TypeError: cannot concatenate 'str' and 'int' objects
如何将字符串添加到整数?