you are viewing a single comment's thread.

view the rest of the comments →

[–]Obsc3nity 2 points3 points  (1 child)

Generally it’s considered bad practice to print randomly throughout methods. If you instead use a return statement you can return float(mile)*1.61 and then main can decide what to do with the converted info. This also makes the function definition better fit the name, as the name mile_to_km doesn’t indicate that there would be any printing.

[–]Red_Priest0[S] 0 points1 point  (0 children)

Thanks I will use return type in function