When I tried
total = 0
with open('/Users/richarddillon/Desktop/numbers.txt', 'r') as infile:
for line in infile:
total += float(line)
print(total)
Python returned "ValueError: could not convert string to float: "
Richard
On Aug 30, 2014, at 1:13 PM, Alan Gauld <[email protected]> wrote:
> total = 0
> with open('/Users/richarddillon/Desktop/numbers.txt', 'r') as infile:
> for line in infile:
> total += float(line)
> print(total)
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor