Python lab question

I’ve been working on this lab for a while and I can’t get my output to print how I want it. I attached a screenshot of the instructions as well as my code. My program isn’t producing any output and I’m not sure why.

You should not attach images of code in any case. They are bad for accessibility reasons and also make it harder for anyone to help you, since it’s not possible to easily copy-paste your code to try out. Please always post code as actual text in formatted code-blocks.

3 Likes

The function driving_cost is returning the value of result, which is the result of print(...). print will print and then return None. You should remove the print part and just return the result of the f-string.

2 Likes