0
I'm doing the fruit bowl quiz in Python but I don't understand why it is not working.
Here is my code fruit = int (input()) pies = int ((fruit / 2) // 3 ) if fruit % 2 == 0: print (pies) else: print ("The number of fruits must be even!!") The code passes the 2 first test chases and fails the 3 last. Any ideas?
3 Answers
+ 4
Georg Karadimas ,
the first 2 lines in the code are ok. in the second line all calculation that is required is done correctly and then stored in the variable `pies`.
we need just to print this result, without any use of if... else...
so the final code for you is just 3 lines.
+ 2
Thanks for your help
0
Thanks a lot.