+ 1

Why my code in code coach isn't working?

1st two cases are successfully completed but others is not working. https://code.sololearn.com/cT9Nadcd4r9l/?ref=app

4th Mar 2023, 7:11 AM
Nikoloz Kuprashvili
Nikoloz Kuprashvili - avatar
6 Answers
+ 3
You may try to replace round() by Math.ceil() or Math.floor. Math.ceil() will get the maximum integer value of your input. Math.floor() wil get the smallest integer value of your input.
4th Mar 2023, 7:50 AM
Hadrien BASSERY
Hadrien BASSERY - avatar
+ 2
</CODER> I advise you try it in Halloween Candy project and test it as it will not pass the last tests. You really must use Math module else it will keep failing for whatever reason, even if the code is right as you noticed it too...
4th Mar 2023, 10:15 AM
DMarci
+ 1
Yes but in other cases i "fail"
4th Mar 2023, 7:46 AM
Nikoloz Kuprashvili
Nikoloz Kuprashvili - avatar
+ 1
thanks i will try
4th Mar 2023, 7:51 AM
Nikoloz Kuprashvili
Nikoloz Kuprashvili - avatar
+ 1
THANK YOU. It is working
4th Mar 2023, 7:53 AM
Nikoloz Kuprashvili
Nikoloz Kuprashvili - avatar
0
Your code is working, if I put number inputs
5th Mar 2023, 2:36 PM
Disha Mustafi
Disha Mustafi - avatar