Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

Im not sure of the problem in the code. It doesn’t bring up any errors or anything but I’m not clearing step 15. I understand if it’s false then I need to print the opposite. However, maybe I’m not aware of what to input for the program to read it side being flash

Your code so far

distance_mi= 3 
is_raining= True
has_bike= True
has_car= True
has_ride_share_app= True

if not isinstance(distance_mi, int) and distance_mi <= 0:
    print('False')
if distance_mi <= 1 and is_raining:
    print('True')
else:
    print('False')
if distance_mi > 1 and distance_mi <= 6 and has_bike:
    print("True")
elif is_raining:
    print('False')
if distance_mi > 6 and has_car and has_ride_share_app:
    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.3 Safari/605.1.15

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

Welcome to the forum @Isaiah !

Please organize your code so it prints only one thing.

Happy coding!

would a distance_mi of 0, which is a falsy value, return False as requested? it is an integer

okay I have cleaned and organized my code along with fixing my first initial problem. However, my code is still not passing steps 17 and up because of what I assume is my statements being to close together?? I’m honestly not to sure. Here is my code

distance_mi= 3

is_raining= True

has_bike= True

has_car= True

has_ride_share_app= True

if distance_mi > 0:

if distance_mi <= 1 and is_raining == False:

print(‘True’)

elif distance_mi > 1 and distance_mi <= 6:

if is_raining == False and has_bike == True:

print(‘True’)

elif distance_mi > 6:

if has_ride_share_app == True and has_car == True:

print(‘True’)

else:

print(‘False’)

In the actual code itself the second if statements are indented correctly , im just not sure how to paste that here

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

Please review User Story #7 again. Does this if statement meet that requirement?

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