Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- myfile = 'list.txt'
- fh = open(myfile,'r')
- calorie = 0
- highest_cal = 0
- for line in fh:
- if (line.isspace()) == True:
- if (calorie>highest_cal):
- highest_cal = calorie
- print(calorie)
- calorie = 0
- else:
- calorie+= int(line)
- print(highest_cal)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement