Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

I’m unsure of where the logic is breaking down. no matter what value distance_mi has, I get False as the output. It says 21 and 23 aren’t there, but I have them formatted the same way as everything else that has worked up to this point. Any feedback is appreciated! When I add ‘’‘else: print(False)’‘’ it fails every step.

Your code so far

distance_mi = 7
is_raining = False
has_bike = False
has_car = True
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 and is_raining == True:
    print(False)

elif distance_mi > 1 <= 6 and has_bike == True and is_raining == False:
    print(True)

elif distance_mi > 1 <= 6 and has_bike == False and is_raining == False:
    print(False)

elif distance_mi >1 <= 6 and has_bike == False and is_raining == True:
    print(False)

elif distance_mi > 6 and has_car == False and has_ride_share_app == False:
    print(False)

elif distance_mi > 6 and has_car == True and has_ride_share_app == True:
    print(True)

elif distance_mi > 6 and has_car == False and has_ride_share_app == True:
    print(True)



   
    


  
  

Your browser information:

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

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

this is not doing what you want, you are doing two comparisons here, distance_mi > 1 and 1 <= 6, you are not comparing distance_mi with 6

Do both has_car and has_ride_share_app need to be True?

Then how do you indicate that distance_mi has to be at least 1? is it just assumed?

Okay, I fixed the comparison for ‘’‘distance_mi <= 6’‘’, but now its saying that 22 is wrong. Am I supposed to have them listed individually adn not add the has_ride_share_app part for that bit only? or do I need to add another elif condition? I’m just confused cause it was checked off before I deleted the >1 bits that were before distance_mi but now it’s saying it’s not done. Thank you for the help!

How else would that be written if those are the two conditions? Is there a way to label those both as ‘True’ without having to write it out individually like I have here?

do they need to be both true at the same time?
Doesn’t it say

  • You should print True if the person has a car or has a ride-share app.