将数字除以包含值的字符串?

dividing a number by a string that contains a value?


我定义,比方说,E=10 我尝试做 A=1/E(在 python 中),然后 python 告诉我:

TypeError: unsupported operand type(s) for /: 'int' and 'str'

请问我该怎么做?

谢谢!

>>> E=10.0
>>> A=1/E
>>> print(A)

0.1