pls help me solve this or just hint me. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 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.

16th Jul 2021, 9:42 PM
Timi
Timi - avatar
2 Answers
+ 1
All you have to do is divide the distance by the speed to get the time.
16th Jul 2021, 10:16 PM
inxanedev!
inxanedev! - avatar
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)
17th Jul 2021, 7:30 AM
you are smart. you are brave.
you are smart. you are brave. - avatar