Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

I got stuck at 15, can someone help me figure out

Your code so far

distance_mi = 12
is_raining = True
has_bike = True
has_car = True
has_ride_share_app = True

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


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36 Edg/144.0.0.0

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

Try changing the values to matching that test case see what will be printed, ie.:

distance_mi = 0.5
is_raining = False

The code is supposed to have an if, elif, and else structure. The best way to describe the difference is to say yours is an if, else.

Check out almost at the bottom of this codecamp page, just above the questions, where it demonstrates the if, elif (elif, elif) else structure.

forgive the missing link, I’m not able to direct you to the proper codecamp page with the instructional materials. Find the codecamp page titled: How Do Conditional Statements and Logical Operators Work? The part you want is just above the questions, at the bottom.

you linked the correct page, https://www.freecodecamp.org/learn/python-v9/lecture-booleans-and-conditionals/how-do-conditional-statements-and-logical-operators-work

the link becomes a rectangle like below if it’s alone on a line

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.