Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

ok I’m lost I checked all my code and got returns for everything with proper feedback on it without any errors codes but its saying that its not printing the False value or the other codes that I put in when I see it is? what am I missing here

the main issue I’m having is that the code is working via the feedback in console but instructions say its not working for the distance_mi == False while distance_mi = 0

I hope this makes sense.

Your code so far

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

if distance_mi == False:
    print('False')
else:
    print('True')

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

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

if distance_mi > 6:
    print('True')
elif has_car and has_ride_share_app == True:
    print('True')
else:
    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/151.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

Tell us what’s happening:

ok I’m lost I checked all my code and got returns for everything with proper feedback on it without any errors codes but its saying that its not printing the False value or the other codes that I put in when I see it is? what am I missing here

the main issue I’m having is that the code is working via the feedback in console but instructions say its not working for the distance_mi == False while distance_mi = 0

I hope this makes sense.

Your code so far

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

if distance_mi == False:
    print('False')
else:
    print('True')

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

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

if distance_mi > 6:
    print('True')
elif has_car and has_ride_share_app == True:
    print('True')
else:
    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/151.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

how many things are printed to the terminal?

you need to have only one thing at a time printed to the terminal

Tell us what’s happening:

OK I’m confused shouldn’t my code be showing a True response with this code. I’ve read multiple other peoples projects on here trying to find insight on how to write the code to where it runs right but its confusing me on why its not coming back correct.

to be clear console comes back with a False reading and from my understanding it should come back with a True reading due to what the code is.

I’m trying to get feedback on my code and what I might be messing up on to make it run how I want it to

Your code so far

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

if distance_mi:
    print('False')
elif distance_mi <= 1 and not is_raining:
    print('True')
else: 
    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/151.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

Continuing the discussion from Build a Travel Weather Planner - Build a Travel Weather Planner:

Tell us what’s happening:

Your code so far

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

if distance_mi <= 1 and not is_raining:
    print('True')
else: 
    print('False')

so I did get this to work this way though why did it not work with the elif statement?

Lesson URL (copy - paste from your browser’s address bar)

Hi @Malachi_Cearley

To help you debug, change the if statement to print 123

What appears in the console?

Happy coding

Hi @Malachi_Cearley

I went ahead and combined your posts for you. In the future, just reply to the original thread to add further updates.

Happy coding

when I change the if statement to print 123 it prints 123 as long as the value for distance_mi = 0

Can you please post your full code?