Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- file = input('Input file? ')
- file = open(file)
- data = file.readlines()
- for line in data:
- line = line.split()
- sum = 0
- days = 0
- print(line[1], '(ID#' + line[0] + ') worked ', end='')
- for i in range(2, len(line)):
- sum += float(line[i])
- days += 1
- print(round(sum, 1), 'hours (' + str(round(sum / days, 1)) + '/day)')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement