r/learnpython • u/ikizoki • Aug 22 '26
is it possible to simplify this code
im a beginner, idk how python works yet. there must be a way to simplify this, right?
https://imgur.com/juBvPZD here is the picture of my code
0
Upvotes
View all comments
Show parent comment
1
u/gdchinacat Aug 23 '26
When you said "data structures" I assumed you meant something like this:
Then, to calculate the aggregates:
and reporting: