Where am I need correct? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Where am I need correct?

I get stuck in this challange I don't know how to fix: 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 https://code.sololearn.com/cGx64p4DGPjm/?ref=app

7th Feb 2021, 2:33 PM
Nguyễn Quốc Hưng
Nguyễn Quốc Hưng - avatar
6 Answers
+ 2
1. 'fruits' is a string, and not a variable. To use variable emobe the quotation marks, fruits. 2. You don't need to have float values since the problem is asking for the whole number. I used 'int' to convert the result to integer or whole number. If you have more questions, please feel free to ask. Thanks. https://code.sololearn.com/cJsbFqwDiQeH/?ref=app
7th Feb 2021, 2:40 PM
noteve
noteve - avatar
+ 2
I can't understand
9th Feb 2021, 7:30 AM
Krushna Gayakke
Krushna Gayakke - avatar
+ 1
fruit = int(input()) print(int(fruit/(2)//(3)))
7th Feb 2021, 2:42 PM
Atul [Inactive]
+ 1
You don't have to convert it into float
7th Feb 2021, 2:43 PM
Atul [Inactive]
+ 1
Thanks! I think I will have to review the lesson more carefully
8th Feb 2021, 12:29 AM
Nguyễn Quốc Hưng
Nguyễn Quốc Hưng - avatar
9th Feb 2021, 7:31 AM
Krushna Gayakke
Krushna Gayakke - avatar