I want to convert an entered lb weight to kg and I get the following error...
TypeError: unsupported operand type(s) for /: \'unicode\' and \'float\'<
Pay attention to the error message TypeError: unsupported operand type(s) for /: 'str' and 'float'
>>> kgweight = lbweight/2.20462
Traceback (most recent call last):
File "", line 1, in
kgweight = lbweight/2.20462
TypeError: unsupported operand type(s) for /: 'str' and 'float'
>>>
So if 2.20462 is a float then which is a string here? What does the documentation say about raw_input?
If the prompt argument is present, it is written to standard output without a trailing newline. The function then reads a line from input, converts it to a string (stripping a trailing newline), and returns that. When EOF is read, EOFError is raised.