为什么会提示 TypeError: can only concatenate str (not "int") to str
已经在另外一个函数方法里面强制类型转换过了
data_dict = {}
for Record in all_data:
if Record.data in data_dict.keys():
data_dict[Record.data] += Record.morey
else:
data_dict[Record.data] = Record.data
print(data_dict)
Traceback (most recent call last):
File "E:\pycm\yunjiang\练习2\数据分析案例\main.py", line 13, in
data_dict[record.data] += record.morey
TypeError: can only concatenate str (not "int") to str