0

Who can help me to solve this in python

You have a bowl on your counter with an even number of pieces of fruit in it. Half of them are bananas, and the other half are apples. You need 3 apples to make a pie. Task Your task is to evaluate the total number of pies that you can make with the apples that are in your bowl given to total amount of fruit in the bowl. Input Format An integer that represents the total amount of fruit in the bowl. Output Format An integer representing the total number of whole apple pies that you can make. Sample Input 26 Sample Output 4

7th Jan 2022, 7:22 AM
Wijdene Madiouni
Wijdene Madiouni - avatar
3 Answers
+ 2
let's consider 'fruits' is the input representing the number of fruit. * fruits = int(input("number of fruit")) * fruit divided by 2 will give you the number of apple * You need 3 apples for 1 pie therefore you should divide the number of apples on 3 to get the number of pie you can try : fruits = int(input("number of fruit")) pie = (fruits/2)//3 #modulo is used here to get an integer
7th Jan 2022, 7:30 AM
YoPycode