0

I'm on python beginner and not on pro. This is the first time am doing any language. I need your help on this question

You are flight from LA to Sydney covering a distance of 7425km at a speed of 550 km/HR. Calculate the time and the answer should be a float. And this was my code distance = 7425 speed = 550 print ( distance // speed) I'm sorry for that code but am just trying learn

10th Jul 2021, 10:05 PM
Philippe Ezekiel
Philippe Ezekiel - avatar
2 ответов
+ 4
// is used for whole division in python3 (return an int) you must use / for float division ^^
10th Jul 2021, 10:19 PM
visph
visph - avatar
+ 4
by using print(distance/speed) you will print the time in (float) hour ;)
10th Jul 2021, 10:21 PM
visph
visph - avatar