Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

Can’t figure out what #15 actually requires please help, I tried setting the distance_mi to ‘0’ but it did nothing. Stuck at the moment and just want to get past this stage, it’s the last requirement needed. Any help appreciated

Your code so far

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


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

if distance_mi == 0:
    print('False')

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

Welcome to the forum @pablomcavanagh !

Will your code ever reach the if statement that checks if distance_mi is falsy? Also, what if distance_mi is “”, etc?

Does it make sense to check for a falsy value at the end of your code?

When the and and or operators are used in the same if statement, in what order are they evaluated?

Happy coding!

I tried different variations in places of the code, started with the top, somewhere in the middle as an elif and nothing changed.

Output did nothing changing it to other falsy values, after replacing it back at the top of the code.

Assuming by your last part by the I have to input it into the falsy value input, just not sure how that’d work, grateful for the hints regardless

edit: nvm I fixed the falsy issue which just took away the ‘ok’ with my elifs on 16, 20-22

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