We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
It seems like the issue is handling test cases 0 and 1 together. Try separating the logic for each test case like this:
For test case 0, handle it with an if condition to avoid errors (like division by zero). For test case 1, manage it separately with an elif. That way, you prevent both test cases from interfering with each other.
Hope that clears it up! Let me know if you need more help.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Join us
Create a HackerRank account
Be part of a 26 million-strong community of developers
Please signup or login in order to view this challenge
Python: Division
You are viewing a single comment's thread. Return to all comments →
It seems like the issue is handling test cases 0 and 1 together. Try separating the logic for each test case like this:
For test case 0, handle it with an if condition to avoid errors (like division by zero). For test case 1, manage it separately with an elif. That way, you prevent both test cases from interfering with each other.
Hope that clears it up! Let me know if you need more help.