I have this code, as you can see, every loop has a different x value, I want to sum them all up at the end:
my_ranks = {
'Math': 'A',
"Science": 'B',
'Drawing': 'A',
'Sports': 'C'
}
for rank,value_rank in my_ranks.items():
if value_rank=="A":
x=100
elif value_rank=="B":
x=80
elif value_rank=="C":
x=40
print(f"my rank in {rank} is {value_rank} and this equal to {x} points")