Assuming that '
End
' in
Quote:
Palmsprings, romance, 33,End 8.0
is just a typo, you could write a code similar to
s = '''Jumpst, comedy, 89, 6.0
Endgame, science-fiction, 58, 4.5
Up, animated, 42, 3.0
IT, horror, 50, 6.2
Johnwick, action, 10, 5.9
Palmsprings, romance, 33, 8.0
Parasite, thriller, 12, 0.75
Harrypotter, fantasy, 60, 6.0
Babydriver, music, 22, 4.3
1917, war, 66, 1.75'''
sum = 0.0
for line in s.splitlines():
f = line.split(',')
sum = sum + float(f[2]) + float(f[3])
print(sum)