+ 2
Need help understanding math of distance converstion
Hello, I tried to solve the question highlighted in the triple quotes below. I assumed that dividing by 1.6 to fiind what 1 kilometer in miles is then multiplying by 1000 for 1000 km should give the correct unit the answer suggests (624.0) but it does not. When I checked online 1000km = roughly 621.37 miles, so why is the accepted answer 624? Also when I do floor divison like 1000//1.6 i get 624 but when i do regular division of 1000/1.6 I get 625, why is this so if there is no remainder? Thanks https://code.sololearn.com/cTLoF70bpp1E/?ref=app
4 odpowiedzi
+ 3
+ 2
you can use //int but not recommended using //float
+ 1
Using // and a floating number as a dividend is the reason why you get an error.
+ 1
print(1000//1.61) #take 2decimals =>621