Tell us what’s happening:
I don’t know what I doing wrong here please explain why 20. says its wrong
Your code so far
distance_mi = 0
is_raining = False
has_bike = True
has_car = True
has_ride_share_app = True
if distance_mi == 0:
print(False)
elif distance_mi <=1 and not is_raining:
print(True)
elif distance_mi <=1 and is_raining:
print(False)
elif 1 < distance_mi<= 6:
if is_raining == True or has_bike == False:
print('False')
Your browser information:
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36
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
dhess
2
Hi @mixw8352,
It doesn’t look like you’ve implemented User Story #7 yet.
Also, 0 is not the only falsy value.
Happy coding!
user story #7 what does that mean?
ILM
4
the 7th item in the numbered list
distance_mi = 0
is_raining = False
has_bike = True
has_car = True
has_ride_share_app = True
if not distance_mi:
print(False)
elif distance_mi <=1 and not is_raining:
print(True)
elif distance_mi <=1 and is_raining:
print(False)
elif 1 < distance_mi<= 6:
if is_raining or not has_bike:
print(‘False’)
I don’t get what I’m supposed to be adding here
Tell us what’s happening:
number 20 is the last one and it is not accepting for some reason what am I doing wrong.
Your code so far
distance_mi = 0
is_raining = False
has_bike = True
has_car = True
has_ride_share_app = True
if not distance_mi:
print(False)
elif distance_mi <=1 and not is_raining:
print(True)
elif distance_mi <=1 and is_raining:
print(False)
elif 1 < distance_mi<= 6:
if is_raining or not has_bike:
print('False')
elif distance_mi >6 and has_ride_share_app:
print(True)
elif distance_mi > 6 and has_car:
print(True)
elif 1 < distance_mi ==6 and has_bike and not is_raining:
print(True)
else:
print(False)
Your browser information:
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36
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
Hi @mixw8352
What is the output when the distance is set to 2?
Happy coding
ILM
8
distance_mi = 2
is_raining = False
has_bike = True
has_car = True
has_ride_share_app = True
try with this, what is printed?
dhess
9
I went ahead and combined your posts for you. In the future, just reply to the original thread to add further updates.
nothing changes..distance_mi = 2
is_raining = False
has_bike = True
has_car = True
has_ride_share_app = True
if not distance_mi:
print(False)
elif distance_mi <=1 and not is_raining:
print(True)
elif distance_mi <=1 and is_raining:
print(False)
elif 1 < distance_mi<= 6:
if is_raining or not has_bike:
print(False)
elif distance_mi >6 and has_ride_share_app:
print(True)
elif distance_mi > 6 and has_car:
print(True)
elif 1 < distance_mi <= 6:
if has_bike and not is_raining:
print(True)
else:
print(False)
ILM
11
please formar your code, Python really needs to be formatted to be readable
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 (').
dhess
12
Oh? Is anything printed in the console?
no nothing is printed on the console
Teller
14
Shouldn’t something print to the console?
ILM
15
that’s not good, shouldn’t something always be printed? check your conditions, do you have one for the current condition?