Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

Hello, i looked at other posts on the forum about steps 17 and 18 but none explained them in detail.

I tested each of the steps and they all turn out like they wanted.

I also looked at the user story as well for help and followed it but maybe I formatted it wrong.

Unrelated: how does freecodecamp check for the lab being correct is it word for word or is it based on the terminal output. I was just wanting to know this to help with future labs.

Thank you for all the help.

Your code so far

distance_mi = 6
is_raining = False
has_bike = False
has_car = False
has_ride_share_app = False

if not distance_mi:
    print('False')
elif distance_mi <= 1 and not is_raining:
    print('True')
elif 6 >= distance_mi > 1 and not is_raining and has_bike:
    print('True')
elif distance_mi > 6 and has_ride_share_app or has_car:
    print('True')
else:
    print('False')

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

This is one of the cases that has problems:

distance_mi = 4
is_raining = True
has_bike = False
has_car = True
has_ride_share_app = True

Per specification, the printed should be "False", but actual output is "True".

Usually, if it’s possible then the output is checked, or ie. what function returns. This can get way harder if something specific needs to be tested in the function, or class internals, so sometimes less flexible ways are used. Generally though, the intent is to not require the code to be identical to every character. This differs with the expected result/output - most of cases they should be identical as the expected.

In this case the actual output is checked. If you’d want to see the specifics, test code is available in the repository freeCodeCamp/curriculum/challenges/english/blocks/lab-travel-weather-planner/694acade1d4afdbce71e5840.md at main · freeCodeCamp/freeCodeCamp · GitHub.

1 Like