Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

I am failing to get past step 15 ‘when distance is a falsy value, program should print False’

Your code so far

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

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

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

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

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

Your browser information:

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

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

I believe it has something to do with the structure of your if statements. Your terminal is printing out two values when it should only be returning one. IE. if you set distance_value=0 the terminal outputs

False
False

when it should output

False

I recommend going back over this lesson in the curriculum and reformatting your if statements to only print one response in the console

P.S. Welcome to the forum, were glad to have you here. Good luck, and Happy coding. Shoot me a reply if you still have issues after going back over that linked lesson.

Thank you for the headsup!

1 Like

No problem. If this helped you solve your problem I just request that you mark the post as solved by selecting the little check box under my reply. Good luck, Happy Coding. Reach back out if you have any further issues.

@dhess could you by chance fix this where the correct reply is marked as the solution. OP marked it as solved just not on the post that contains the relevant information. Thanks! and Happy Coding @Devi10Mt Glad you were able to figure it out!