Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

Hello everyone,

I’m a beginner, and I’m having some trouble with this code. I’ve already tried rewriting it several times, but I still can’t figure out what I’m doing wrong.

If anyone could take a look and point me in the right direction, I would really appreciate it. Any help or advice would mean a lot.

Thanks in advance!

Your code so far

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


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


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


if distance_mi > 6 and has_car == True or has_ride_share_app == True:
    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/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

Welcome to the forum @rachel.sengineer,

Your code should only print one thing – either True or False.

And here’s a good reference to learn about falsy values and how to check for them:

Happy coding

Hi @dhess,

I checked the article, but noticed it uses JavaScript. Since I used Python to write my program, does the same logic still apply, or is there a difference?

Thanks for the help!

Oops! Here’s the Python version: