Hello everyone, I need help about this Lab. I made the first part but I cannot watch what’s wrong. I have a great OK till 14 but I don’t know, I’m feeling low. Here’s my code:
distance_mi=1
is_raining=False
has_bike=True
has_car=False
has_ride_share_app=True
if distance_mi ==0:
print("False")
elif distance_mi <=1 and is_raining==False:
print("True")
else:
print("False")
if distance_mi >1 and distance_mi <=6 and (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")
Sorry, I understood that the program reads each line of code until it executes the one that is correct for the given conditions.
I’m new to all this, and I don’t really understand how it works. Could you explain it to me (not give me the solution), please?
Because in my mind, it seems that it will read each one and ignore the others when the appropriate code is found for execution.