+ 1
What is the bug of this code??
fruit = int(input()) if fruit%3 == 0: print(fruit/3) else: print("0") #your code goes here
15 Answers
+ 10
Fruit bowl?
All you need to divide variable fruit by 6 using floor division `//`
+ 8
print(0) instead of print("0")
+ 4
Abdullah Al Abid Your question always printed 0 because
You tried to set a equation of "if fruit // 3 == 0 :" which made it always print 0 but I just declared a variable "declare" to contain fruit // 3 in one variable so that it would be easy to solve it your code was right but the error occurred because of if statement having the equation
Happy Coding! đ
+ 4
Calvin [Inactive] I didn't completely understand
But sounds interesting.
Could u explain in detail please?
+ 4
Do fruit divided being like this in close fruit //3
+ 3
I got it. Thanks a million all of you ....
+ 3
fruit = int(input())
if fruit%3 == 0:
print(fruit//3)
else:
print("0")
+ 2
result : input = 4
my code answer = 0
Showing answer = 0
although
my code answer = showing answer;
It is showed that my answer is not
fully correct....
+ 2
Could you specify the task name and the course ?
I believe it is related to your float division (fruit/3)
+ 1
Hi Abdullah Al Abid
https://code.sololearn.com/c4HVEZq9ah9c/?ref=app
See this is answer
If any doubts then ask Me
Happy Coding!
+ 1
Tnx a lot. But it is also same, right??
+ 1
I think, there are not any special bugs. Because of coding isnot a game. You must coding by your knowledge. May be, there are bugs, but I dont know. This is my opinion
0
Float
- 1
Print("0") ; đ
- 2
G