+ 1
Help a Noob... Pls explain the process 😉
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.
2 Respostas
+ 3
In order to solve the problem, you first need to know the formula for rate, distance, and time. (**note rate is also know as speed**)
Rate * Time = Distance
Miles / Hour * Hour = Miles
Time = Distance / Rate
Step One: Create 3 Variables
distance = 7425
rate = 550
time = distance / rate
Step Two: Print Result
***Optional*** Turn time into a float (decimal) using float function float()
print(time)
or
print(float(time))
Step Three: Run! Results should say 13.5.
+ 2
time = speed / distance
Speed is given in hour so you have to convert in miles / minutes.