0
What's the answer?
The title is You need to calculate the flight time of an upcoming trip. You are flying from LA to Sydney, covering a distance of 7425 miles, the plane flies at an average speed of 550 miles an hour. Calculate and output the total flight time in hours. Hint The result should be a float. My answer is Print (7425//550) Anything wrong with my answer? I have no idea.
2 ответов
+ 9
Ferris ,
▪︎the task description says that the result has to be a float not an int, use / instead of //.
▪︎also print() has to be spelled in lowercase letters.
happy coding!
+ 1
Lothar Thank you sooo much. I nailed it finally. 😀😀😀😀😀😀
I saw one comment before:
For those who are surprised that the correct answer is not "6". It's because in Python Operators;
"/"(single bar) returns a float type number
whereas;
"//"(double bars) returns integer type number
And as there is "/" in the equation, it returned the float type to value 6, making it become a float type number with a decimal place.
Right answer: 6.0 (float type)