My program is supposed to read a text document with a bunch of numbers and make a list of only the positive numbers. I can’t convert the strings from the text document to a float so i can’t determine if they are postive.
I linked a screenshot because my copy paste is buggy.

https://i.stack.imgur.com/L1Z7z.png
Without the number = float(number) , I get ['3.7', '-22', '3500', '38', '-11.993', '2200', '-1', '3400', '3400', '-3400', '-22', '12', '11', '10', '9.0']
You can translate that list into floats easily:
But the problem seems to be that the lines in your file don’t contain individual floats. When you call
float(number),numberis a line from the file, which (from the error) appears to contain three space-separated numbers “3.7 -22 3500”.What you need is to call the
floatfunction after splitting:Or, more functionally: