Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

I keep running into error 15 and 20, Not sure how to fix this.

15. When distance_mi is a falsy value, the program should print False.
20. When the distance is between 1 mile (excluded) and 6 miles (included), a bike is available, and it is not raining, the program should print True.

Your code so far

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

if distance_mi <= 1:
    if not is_raining:
        print('True')
    else:
        print('False')
elif 1> distance_mi <=6:
    if has_bike and not is_raining:
        print('False')
    else:
        print('True')
elif distance_mi > 6:
    if has_car or has_ride_share_app :
        print('True')
    else:
        print('False')
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

Welcome to the forum @whoolian !

What does your code return if distance_mi = 0?

consider what you have written here, 1 > distance_mi means that distance_mi is lower than 1, is this what you want to write in this condition?

thank you, I eliminated that error.

How do i check that?

change the line in which you assign a value to distance_mi

It came back ‘False”

I am still getting the error message, unsure how to fix it.

if distance_mi==0:

    print('False')

if distance_mi <= 1:

    if not is_raining:

        print('True')

    else:

        print('False')

elif 1< distance_mi <=6:

    if has_bike and not is_raining:

        print('True')

    else:

        print('False')

elif distance_mi > 6:

    if has_car or has_ride_share_app :

        print('True')

    else:

        print('False')

else:

    print('False')

I’ve edited your post to improve the readability of the code. 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 (').

1 Like

I do not see False, what I see instead is

False
False

isn’t that too many False?

Im unsure where to look to see this.

in the terminal on the right

thank you for the help!