total = 0 with open('er11.csv', 'r') as inp: for line in inp: try: num = float(line) total += num except ValueError: print('{} is not a number!'.format(line)) mean total/len(open('er11.csv').readlines()) print('Total of all numbers: {}'.format(total)) print(mean)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)