Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

i cant get pass 16 to 23 , i dont understand what im doing , im so confused ,i need help

Your code so far

distance_mi = 0.5
is_raining = True
has_bike = False
has_car = False
has_ride_share_app = False
if not distance_mi == 0:   
    if distance_mi <= 1 and is_raining == False :
        print(True)
    elif distance_mi <=1 and is_raining:
        print(False)
    if distance_mi > 1 and distance_mi <= 6:
        if is_raining == True and has_bike == False:
            print(False)
        elif is_raining == False and has_bike == False:
            print(False)   
        elif is_raining == False and has_bike == True:
            print(True) 
    if distance_mi > 6:
        if has_ride_share_app == True:
            print(True)
        elif has_car == True:
            print(True)
        elif has_car == False or has_ride_share_app == False:
            print(False)
    
print(bool(distance_mi))

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

Hi @ChelseaJ,

What does your code print if distance_mi is 0?

Happy coding

false

my no 15 is ticked

im having issues from 16 down

Your function is not printing False when distance_mi is 0. It prints nothing in that case. The only reason you would see False in the console when distance_mi is 0 is because you’re forcing it with this print:
print(bool(distance_mi))

So, start there to fix your code.

ohhhhh i see
now im having problem with no 15, 21 - 23
i dont know what to do

Please post your updated code, formatted as follows:

There are two ways you can format your code to make it easier to read and test:

  1. After you copy/paste your code into the editor, select it by dragging your cursor over it then click the (</>) button in the toolbar to automatically wrap your code in backticks. (You can click on the animated demo image below to enlarge it.)

  1. Manually add three backticks on a new line above your code and on a new line after your code. Note that a backtick is NOT the same as a single quote('). To find the backtick key on your keyboard, see this post.

To see changes to your post as you make them, you can click the (M+) button on the toolbar to bring up the rich text editor:

distance_mi = 0
is_raining = False
has_bike = False
has_car = False
has_ride_share_app = False
if not distance_mi == 0:
    if distance_mi <= 1 and is_raining == False :
        print(True)  
    elif distance_mi <=1 and is_raining == True:
        print(False)
        
    if distance_mi > 1 and distance_mi <= 6:
        if is_raining == True and has_bike == False:
            print(False)
        elif is_raining == False and has_bike == False:
            print(False)   
        elif is_raining == False and has_bike == True:
            print(True) 
    if distance_mi > 6:
        if has_ride_share_app == True:
            print(True)
        elif has_car == True:
            print(True)
        if (has_car  or has_ride_share_app) == False:
            print(False)
           
    


this is my code now

im having problem with just no 15 the falsy value

Your code still isn’t printing anything if distance_mi is 0. You have an if statement if distance_mi is not 0, but what if it is? BTW, 0 is not the only falsy value. Please refer to this reference to get an understanding of falsy values:

please

i still dont understand

Please review this theory lecture:
Booleans and Conditionals - What Are Truthy and Falsy Values, and How Do Boolean Operators and Short-Circuiting Work? | Learn | freeCodeCamp.org

And please don’t overlook this instruction:

You should use if, elif, and else statements to evaluate the distance categories in ascending order.

So far, your code has only used two of those statements.

im trying

im getting more confused

im tired i will continue tomorrow

Sleep on it and let us know later if you have a specific question about something that you are confused about.

thank you

i have figured it out

i did

and i just figured it out

thank you