Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

I am unsure how to pass from this, it is not accepting my conditions, if i try to fix steps 18/19 it will not allow steps 20/21, unsure how to fix it to continue on.

Your code so far

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

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





    


   

Your browser information:

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

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/lab-travel-weather-planner/694acade1d4afdbce71e5840.md at main · freeCodeCamp/freeCodeCamp · GitHub

Hi @gabohurtado34,

Couple of things…

What if distance_mi is 7? Will this condition evaluate to False?

You should use if, elif, and else statements to evaluate the distance categories in ascending order.

Your code is missing one of these statements and, if you include it at the end, you can eliminate some of your elif statements.

Happy coding

Question, because i think i misunderstood the Else statement, I thought i was to only be used at the end of and IF statement to close it as the final conditional. Can it be used in the middle of the code as well? I tried before using the IF statement as a closing conditional for al of my truthy conditionals so if none were true it would print False but it did not work either.

if you have if...elif...else, you can have only one if, you can have as many elif as you want but they need to come after the if, and you can only have one else and it must go at the end, after the if when there are no elif or after the last elif if there is one or more elif