+ 1
fruits = int(input()) apples = fruits /4 while True : print(apples//3) my attempt :(
my attempt-.......fruits = int(input()) apples = fruits /4 while True : print(apples//3) Question-- 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.
6 Respostas
+ 1
errors :-
1) no need to use while loop (it will result in infinite loop)
2) half of the fruits are apple not 1/4
Here is the fix👇
https://code.sololearn.com/cjgmb1gzLx2M/?ref=app
+ 9
Sorry, but your try gives some error messages => indentation error. please rework your code, as far as you can. Thnaks!
+ 4
I have answered your previous question but you deleted it without seeing it.
You can share your code there only without deleting it.
So, coming to your question:
Only half of them are apples.
So, it's 1/2 instead of 1/4.
Moreover, there's no need for while loop. It will keep printing apples divided by 3.So,it will not match your results with the output given. So, remove it. Print the number of pies.
+ 1
Lothar
It will result in identation error because he haven't written it in code playground Instead he wrote in his question. This happened to me sometimes.
0
Thank u for help
I am a noobie :(