0

Help me! The code doesn't work (NO OUTPUT)

Hello, i have a problem with a code of one work of my college, the problem is that: I need to generate a code that convert the miles to km. Firstly I need use the "def" function, so that's the code: def convert_distance(miles): km= miles * 1.6 convert_distance(55) print(km) When I tried to run the code the output is "no output". In the first I thought that the error is the indentation, but no I fixed this problem and still doesn't work, please if I understand what is the problem, I would greatly appreciate the help. I'm new in this issue and I want a tutor :(.

21st Apr 2021, 6:24 AM
Brahian Suárez
Brahian Suárez - avatar
3 Respuestas
+ 3
def convert_distance(miles): km= miles * 1.6 print(km) convert_distance(55)
21st Apr 2021, 6:28 AM
Genuine Stalwart
Genuine Stalwart - avatar
+ 3
def convert_distance(miles): return miles * 1.6 km = convert_distance(55) print(km)
21st Apr 2021, 6:28 AM
ChaoticDawg
ChaoticDawg - avatar
+ 1
Genuine Stalwart Thank u so much!, I don't know that this is the way to write this code! Thanks!
21st Apr 2021, 6:45 AM
Brahian Suárez
Brahian Suárez - avatar