Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

i don’t know what to to as the next step in the code

Your code so far

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

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

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

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

if distance_mi > 6 and has_ride_share_app == True or has_car == True:
    print('True')
else:
    print('False')

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:148.0) Gecko/20100101 Firefox/148.0

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

Hi @1803,

Check your if/else’s in your logic. What this project is getting you to do is to handle cases of values typically that is done by either performing early returning (my favorite method) or if/elif/else chaining.

In this one, you must do if/elif/else to satisfy the story, and there are just a couple problems I see.

  • Your very first if for checking distance_mi is not checking for a falsy value. It’s checking for a truthy value. Remember the not in Python to check for a falsy value.
  • You should take into account that when distance_mi is a falsy value, we shouldn’t be seeing any other output. But, when it’s falsy right now, you can see multiple outputs. You do this by if/elif/else chaining together. Think about this. If distance_mi is a falsy value, why would I check it against any number? And then apply that to your logic.

You got this! Happy Coding.

i’m still confused could you explain it in simpler terms

Please organize your code to print just one thing in the console. For example, if distance_mi is falsy, your code should print False and stop right there.