# [Tutor] stuck

Klaus Jantzen k.d.jantzen at mailbox.org
Mon Apr 8 07:45:47 EDT 2024

```On 4/8/24 03:06, Robert Towne wrote:
> Im unable to figure out what I am doing wrong
>
> def convert_distance(miles):
> km = miles * 1.6
> result = "{:.1f} miles equals {:.1f} km".format(miles,km)
> return result
>
>
> print(convert_distance(12)) # Should be: 12 miles equals 19.2 km
> print(convert_distance(5.5)) # Should be: 5.5 miles equals 8.8 km
> print(convert_distance(11)) # Should be: 11 miles equals 17.6 km
>
>
>
>
>
> Not quite. Check that you're using the format method with the placeholder
> curly brackets and correct decimal place indication.
> _______________________________________________
> Tutor maillist  -Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor

Write the result line as follows

def convert_distance(miles):
km = miles * 1.6
result = f"{miles:.1f} miles equals {km:.1f} km"
return result

Have'nt used 'format' "for ages".

--

K.D.J.
```