0

Could anyone tell me how to solve the fruit bowl challenge with python.

fruit = int(input()) apples = fruit / 2 pie = apples / 3 if pie % 3 == 0: print(pie)

11th Oct 2020, 1:34 PM
Briggs-Ikeotuonye Alleluia Emmanuel
Briggs-Ikeotuonye Alleluia Emmanuel - avatar
3 Answers
+ 4
Your attempt is missing in the question description
11th Oct 2020, 1:35 PM
Arsenic
Arsenic - avatar
+ 4
fruit = int(input()) def apple(data): data = data//2 # this code line was data = data/2 before solving return data b = apple(fruit) print (b // 3) ---------------------------------------------- fruit=int(input()) converts a string into integer so basically asking a user to enter an integer b=apple(fruit) here apple function is called with fruit as argument for the parameter data and result returned from the apple function is assigned to variable b b//3 is called floor division If b is 7 then you will get 2 as output In function apple , In line data=data//2 ,Data is assigned the result as a evaluation of data//2 and returned back to the function call
11th Oct 2020, 1:48 PM
Alphin K Sajan
Alphin K Sajan - avatar
0
That's the code I could think of for that case could you help
11th Oct 2020, 1:47 PM
Briggs-Ikeotuonye Alleluia Emmanuel
Briggs-Ikeotuonye Alleluia Emmanuel - avatar