>>> g = input("Enter a number")
Enter a number43
>>> g + 2
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
g + 2
TypeError: Can't convert 'int' object to str implicitly
该程序不会让我在数学运算中使用输入变量,例如g + 2
>>> g = input("Enter a number")
Enter a number43
>>> g + 2
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
g + 2
TypeError: Can't convert 'int' object to str implicitly
该程序不会让我在数学运算中使用输入变量,例如g + 2