Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- results = [
- 'jane', 4,
- 'jane', 7,
- 'jane', 3,
- 'boi', 5,
- 'boi', 5,
- 'boi', 7,
- 'jude', 10,
- ]
- total = {}
- for index in range(0, len(results), 2):
- if not results[index] in total:
- total[results[index]] = results[index + 1]
- else:
- total[results[index]] += results[index + 1]
- print(total)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement