- #1
MaxManus
- 277
- 1
Homework Statement
I have two programs and neither works. In the first program I don't get any autput from andre(f):
f = open("densities.dat", "r")
def andre(f):
densities = {}
for line in f:
density = float(line[12:])
name = line[0:10].strip()
densities[name] = density
return densities
and in the second program I want to be able to use the numbers and get therfor strip "," and make a float
from math import *
f = open("output.txt", "r")
print type(1e-4)
epsilon = []
exact_error = []
n = []
for line in f:
words = line.split(",")
words = line.split()
print float(words[1].strip(","))