Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

can someone explain further to me why this is wrong

Your code so far

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

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

if distance_mi > 1 and distance_mi <= 6 or(has_bike == True and is_raining == False):
    print("True")
else:
    print('False')
if distance_mi > 6 and(has_car == True or has_ride_share_app == True):
    print("True")
else:
    print('False')
    





Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.2 Safari/605.1.15

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

1 Like

What do you mean “it’s wrong” ? Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

how many things are you expected to print?

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

Does your code satisfy this requirement?

1 Like

thanks that is true, very true

id like to print 3 “arguments”, I have 3.

    1. When the distance is 1 mile or less and it is not raining, the program should print True.
  • Failed:16. When the distance is 1 mile or less and it is raining, the program should print False.

is where I’m stuck on at the moment.

distance is “less than or equal to 1” and it is raining, why do I not pass those checks?

Try to organize you if/elif/else statements so you only print one value.

1 Like

but are you sure that’s what you are asked to print? are you sure that you are not asked to print only one value?
if your distance is less than 1 mile, you should not print anything for more than 6 miles

put everything into one “if” statement? and everything in the body?

Try that using elif as well as if/else.

will get on it. how would I post the new code when I’m finished?

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 (').

Thank you for asking!

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 (').

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.