-5
我正在學習Python和這裏是一段代碼:劃分兩個int變量在python
x = raw_input('Enter a numerator:')
y = raw_input('Enter a denominator:')
print x/y
這給了我一個錯誤:
Traceback (most recent call last):
line 3, in <module>
print x/y
TypeError: unsupported operand type(s) for /: 'str' and 'str'
錯誤清楚地說:你不能分兩個字符串。之前轉換爲int! – TheHippo