I apologise if I am missing something simple here, but I don't understand...
list_rho = []
# start some sort of loop
val = input()
list_rho.extend(val)
With this code I am attempting to create a list of rho values: the user inputs a floating point number. This is then added to the list.
e.g. the user inputs the values 0.10, 0.15, 0.20, 0.30, 0.35
However, when I print the list it appears like so:
0, ., 1, 0, 0, ., 1, 5, 0, ., 2, 0, 0, ., 2, 5, 0, ., 3, 0, 0, ., 3, 5
Clearly, not what I want. The same happens if I try enclosing the input value in quotes or converting the user input to a string first.
Can anyone offer an explanation of what/why this is happening?
N.B. I could use a loop for the values of rho, but, the number of decimal places is important in my end use and I know there is no way of precisely representing 0.1 in base 2...