这是我的代码:为什么我用下面的Python代码获取TypeError?
x = input("Enter a number: ")
print(50/x)
这给了我下面的错误:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
print(50/x)
TypeError: unsupported operand type(s) for /: 'int' and 'str'
输入读取错误。你正试图用一个str来划分一个int。 – user3591723