我的程序应该用一堆数字读取文本文件,并仅列出正数。 我无法将文本文档中的字符串转换为浮点数,因此我无法确定它们是否为正数。
我链接了截图,因为我的复制粘贴是错误的。
http://i.stack.imgur.com/L1Z7z.png
没有number = float(number) ,我得到['3.7', '-22', '3500', '38', '-11.993', '2200', '-1', '3400', '3400', '-3400', '-22', '12', '11', '10', '9.0']
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.
http://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']
更多推荐
发布评论