>>> 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
The program wont let me use the input variable in mathematical operations, like g + 2
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.