+ 1

# How to do calculations in dictionary

https://photos.app.goo.gl/QhwkBYTXL1hs8Aki9

1st Apr 2021, 3:34 PM
13 Respostas
+ 1
The origanalRevenue isn't actually 15000. I think it's 530 but i could be wrong. I'd try that first and then maybe look over your for loop. This is what I used. I can explain my code if you'd like nya = 0 for x in data.values(): if x < age: nya += 5 else: nya += 20
1st Apr 2021, 7:54 PM
Alexander Crum
0
Thanks I'll try.
1st Apr 2021, 7:59 PM
0
Let me know how it goes
1st Apr 2021, 8:04 PM
Alexander Crum
0
Ok
1st Apr 2021, 8:06 PM
0
The if condition of your loop produces the wrong results
1st Apr 2021, 8:45 PM
0
Thats strange. It works for me. Are you sure you've got the old revenue right now?
1st Apr 2021, 9:07 PM
Alexander Crum
0
try using 16 and 10 as discounted age and if you get 5 and 33 respectively as percentage revenue growth then it means you are correct.
2nd Apr 2021, 3:16 AM
0
And please show your full code for me to see how you have worked out except for the dictionary collection
2nd Apr 2021, 3:29 AM
0
The reason why I'm saying you are wrong is your loop multiplies the next value in value list by twice the variable ticket cause of += sign
2nd Apr 2021, 3:33 AM
2nd Apr 2021, 3:39 AM