0
I don't understand the flight time project in python for beginner
Calculate and output the flight time on hours of 7425 miles at 550 miles an hour
15 odpowiedzi
+ 3
Clinton You have to calculate the number of hours to complete the journey.
In one hour you can go upto 550 miles.
So to get the number of hours you have to devide the distance by 550.Like given below
answer = ( 7425 / 550 )
print(answer)
+ 5
For 1hr, => 550 miles
How many hrs for => 7425 miles.?
Time = distance/speed
May it helps there. read description again
+ 2
I'm on the same boat, figured I would just continue here. My code was:
--------------------------
distance=7425
average_speed=550
print(distance//average_speed)
--------------------------
I tried it with another python compiler, it worked no errors. however, sololearn still has it blocked, what am I doing wrong? Legit wanna learn
Update: it was a simple math problem, I got it. I may have thought I needed to do more
+ 1
You can use the following formula to calculate the time:
Time = Distance / Velocity
(assuming the velocity stays constant during the whole time)
+ 1
Look, We have 7425 miles to get to arrive. our plane have a 550miles/hour speed. so the formula is miles/hours!
X: Distance/Speed=hours we on flight
print(X)
0
I'm confused
0
Hi, what exactly is the problem?
0
Thanks guys
0
Hi! Why you use // operator? do you know how it works?
0
i think i know now, // whole number division, / float number?
0
/ - normal division (the result will be converted to float)
// - integer division (the fractional part will be discarded)
0
The answer is:
answer=float(7425.0/550.0)
print("answer")
0
They were talking about floor division and remainders with %. Then threw just regular division into it. Ugh! So confusing.
0
question says hours? so should be 13 hours 7425.0 // 550.
But not the correct way?????
7436.0 / 550 to give 13.5
0
distance=7425
speed=550
print(float(distance/speed))