Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

I initially had the falsy issue. I changed it to an if and else and pushing the nested if/elif/else statement. I am not getting 'Your code has an indentation error. You may need to add [pass] on a new line to form a valid block of code. I’m not sure what that means. I’m obviously still a beginner and I even searched it on google. I tried my code in Collab and it worked so what is expected on here. Please, need assistance. Thank you

Your code so far

distance_mi = 5
is_raining = False
has_bike = False
has_car = False 
has_ride_share_app = False


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

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

    if distance_mi > 6 and has_car or 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

Hi @USMC1071,

To be honest, there is quite a bit off with the logic compared to what is asked within the story objectives.

I’ll immediately tell you that each one of your if statements needs to have its own set of if statements within them, because they are separate checks.

Re-read the steps carefully and recreate the logic, separating out each part. In truth, I would reset the code you have as that may give you a fresh take on the problem.

Thank. I appreciate it

1 Like

Good attempt, but consider the following:

Should this be true if it’s raining and you have a bike? I mean, I wouldn’t want to bike in the rain! :grinning_face_with_smiling_eyes:

What can you change to make sure that has_car or has_ride_share_app is evaluated separately from distance_mi > 6?

Consider using elif instead of else inside the nested else, then doing one else at the end for the False.

Oh, and careful with the indentation in your if/else statements.

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