How to solve this error : TypeError: Can't convert 'int' object to str implicitly
本问题已经有最佳答案,请猛点这里访问。
1 2 3 4 5 6 7 8 | >>> g = input ("enter:") enter: 50 >>> g + 100 Traceback (most recent call last): File"<pyshell#1>", line 1, in <module> g + 100 TypeError: Can't convert 'int' object to str implicitly >>> |
必须先将其转换为int类型
1 | int(g) + 100 |