Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

The program is reading everything as correct but the number 15. If I’m changing/checking anything with distance_mi being falsy, the entire check list becomes wrong so I’m stuck.

Also, I don’t understand why boolean has_car = false (has no car) reads the chain has_car != False as ‘has a car’ when it should be ‘has no car is true’ or am I misunderstanding something?

Your code so far

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

if distance_mi == False:
    print (False)
   
          

if distance_mi <=1:
    if is_raining != True:
        print (True)
    else:
        print (False)

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

if distance_mi >6:
    if has_ride_share_app or has_car !=False:
        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/149.0.0.0 Safari/537.36

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

GitHub Link: https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/blocks/lab-travel-weather-planner/694acade1d4afdbce71e5840.md

Welcome to the forum @Linbene,

Please organize your code so it only prints one thing – either True or False.

Happy coding

What helped me is basically changing some commands (like if to elif somewhere), the code went through. Did i do the assignment? Yes. But did I understand what was wrong? Absolutely not.

Maybe you can come to a better understanding of this challenge by reviewing this theory lecture again:

Booleans and Conditionals - How Do Conditional Statements and Logical Operators Work? | Learn | freeCodeCamp.org