num = input(enter a number:)将用户的输入当作数字(int or float),即num是数字。
测试:
>>>text = raw_input(enter a string:)
enter a string: hello
>>> print type(text)
输出:<type 'str'>
>>>num = input(enter a number:)
enter a number:12.4
>>>print type(num)
输出:<type 'float'>