Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

When distance_mi is a falsy value, the program should print False.

i have been stuck with thsese code for two weeks now can anyone help please

Your code so far

distance_mi=0
is_raining=False
has_bike=True
has_car=False
has_ride_share_app=True 
can_commute=False
if has_car:
    can_commute=True
    print('commute is possible by driving')
elif has_bike and not is_raining:
    can_commute=True
    print('commute is possible by biking') 
elif distance_mi < 2 and not is_raining:
    can_commute=True
    print('commute is possible by walking')
elif has_ride_share_app:
    can_commute=True
    print('commute is possible via ride_share_app')
else:
    can_commute=False
    print('False')    
if distance_mi < 2:
  if not is_raining:
   print('commute is possible: walking')
  elif has_car or has_ride_share_app:
    print('commute possible: car or ride_share_app')
  else:
    print('commute not possible: too wet to walk')
elif distance_mi < 10:
    if has_bike and not is_raining:
        print('Commute possible:Biking') 
    elif has_car or has_ride_share_app:
        print('commute possible:car or ride share app')
    else:
        print('commute not possible')
else:
    if has_car or has_ride_share_app:
        print('commute possible:car or ride share app')
    else:
        print('commute not possible:Too far') 
if distance_mi==False:
    print('False')                
if distance_mi<=1 and not is_raining:
    print('True')
elif distance_mi>1 and distance_mi <=6 and has_bike and not is_raining:
    print('True')
elif 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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36 Edg/147.0.0.0

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

Github Link: freeCodeCamp/curriculum/challenges/english/blocks/lab-travel-weather-planner/694acade1d4afdbce71e5840.md at main · freeCodeCamp/freeCodeCamp · GitHub

Welcome to the forum @jrealhood,

I suggest starting with the fact that your code should only ever print one thing, either True or False.

Also, the instructions did not ask you to create a can_commute variable and there is no need for that.

All of your if statements should be focused on distance_mi and the very first thing you should do is check if that is falsy. If it is, print False and make sure your code does no further processing. Here’s some pseudo code for that:

if distance_mi is falsy:
   print False
else: 
   check conditions for commuting

Happy coding!

thank you for your reply

ok let me start afresh