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.
As for being the same exact equation, I just 'moved' the 3.0 from the denominator to simplify it. Or you could just multiply both the numerator and denominator by 9 to get the same result, without changing the ratio. The ratio will not change if you scale the numerator and denominator the same way: 1/3 == 2/6 == 3/9.
In this case: (10/3) / (4/3) == (10) / (4) == (10*3) / (4*3).
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Python: Division
You are viewing a single comment's thread. Return to all comments →
They are all floats (.0 makes sure they are).
As for being the same exact equation, I just 'moved' the 3.0 from the denominator to simplify it. Or you could just multiply both the numerator and denominator by 9 to get the same result, without changing the ratio. The ratio will not change if you scale the numerator and denominator the same way: 1/3 == 2/6 == 3/9.
In this case: (10/3) / (4/3) == (10) / (4) == (10*3) / (4*3).