- 5
pls help me solve this or just hint me.
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.
2 Réponses
+ 1
All you have to do is divide the distance by the speed to get the time.
0
the formula would look something like this:
dist=7425
spd=550
time=dist/spd
print(time)
if you want to get a little fancier with a function, it would look like this:
def flight_time(dist,spd):
time=dist/spd
return time
if __name__ == “__main__”:
x=flight_time(7425,550)
print(x)