Fruit bowl problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Fruit bowl problem

fruit = int(input()) x=fruit if x%2==0: y=int((x/2)//3) print(y) else: print(0) I tried this but only first 2 test cases I can see are right and the remaining 3 locked cases I can't see are wrong. Please help me with this where I'd gone wrong.

15th Jan 2022, 4:37 AM
Hlyan Phyo Thu
5 Answers
+ 4
print(int(input())// 6) Simply write this OR your edited code: fruit = int(input()) y=int((fruit/2)//3) print(y)
15th Jan 2022, 4:39 AM
NEZ
NEZ - avatar
+ 2
Then, is an even or odd number of total fruit not a problem?
15th Jan 2022, 4:51 AM
Hlyan Phyo Thu
+ 1
It's written that they are even in numbers 🙄.
15th Jan 2022, 5:03 AM
NEZ
NEZ - avatar
+ 1
Aww...Thanks a lot!
15th Jan 2022, 5:16 AM
Hlyan Phyo Thu
0
fruit = int(input()) def applepie (fruit): res = (fruit/2)//3 if fruit <=4: return (0) else: return int(res) print(applepie (fruit))
10th Jul 2022, 12:57 PM
Eugene Nester
Eugene Nester - avatar