Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

My code from 15 is marked X, I have tried everything i can think of it’s not working, please i need pointers

Your code so far

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

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

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

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

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

Please organize your code so it prints just one thing.

some numbers are still marked X please i need pointers
distance_mi = 9
is_raining = True
has_bike = False
has_car = True
has_ride_share_app = True

if distance_mi == False:
print(‘False’)

if distance_mi <= 1:
    print('True')

    if distance_mi > 1 and  distance_mi <= 6: 

        if distance_mi > 6: 
            print('True')
        elif has_car == True:
            print('True')
        elif has_ride_share_app == True:
            print('True')
    elif has_bike == True: 
        print('True')
    elif is_raining == False:
        print('True')
elif is_raining == True:
    print('False')

else:
print(‘False’)

If distance_mi is 0, you are printing two things.

Careful with indentation.

You have if distance_mi > 1 and distance_mi <= 6: inside if distance_mi <= 1:

I suggest testing your code with different values based on your conditions and the user stories to see if it prints what is expected.


If you need more help, please post your updated code, as follows:

When you enter a code block into a forum post, please precede it with three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add the backticks.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

i tried reviewing it making some adjustment to the value of the distance and the bool, it still not passing the code, it seems am missing the logic needed to apply for the code to pass, please help

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

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

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

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

Please review your placement of parentheses here. What you have there is how the conditions will be evaluated without parentheses since the expressions on each side of the and operator would be evaluated first.

Does it make sense to evaluate has_ride_share_app without any consideration of the value of distance_mi?