There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply () below.
If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.
Join the Discussion. Help a fellow learner on their journey.
Ask or answer a question about this exercise by clicking reply () below!
You can also find further discussion and get answers to your questions over in Language Help.
Agree with a comment or answer? Like () to up-vote the contribution!
The directions ask: In our weather_check() function add a second print() statement under the first one which prints a warning message for our travelers! It should print: False Alarm, the weather changed! There is a thunderstorm approaching. Cancel your plans and stay inside.
This is what my code looks like after I add the second print statement:
# Your code below:
print("Checking the weather for you!")
def weather_check():
print("Looks great outside! Enjoy your trip.")
print("False alarm, the weather changed! There is a thunderstorm approaching. Cancel your plans and stay inside.")
When I compare this to the actual solution, I can’t see a difference! But I must be doing something wrong because it’s not letting me progress. Any ideas what I’m missing or doing wrong?
Hello there,
I am also stuck on the step, the solution has the print() function outside of the weather_check() function and therefore contradicts step 3 written instructions.
print("Checking the weather for you!")
def weather_check():
print("Looks great outside! Enjoy your trip.")
print("False alarm, the weather changed! There is a thunderstorm approaching. Cancel your plans and stay inside.")
weather_check()
I wanted to understand that when a function is called the unintended print statement is printed and then the print statement inside the function is printed. Why is that? I mean can anyone explain is that the correct flow I am understanding?
does anyone know why an unindented print statement appears before and indented print statement in a function even if the indented print statement was defined before the unindented statement ?
I noticed that the instructions and error message request for the message to be indented within the function but the solution wants it to be outside the function. Should be fixed.
print(“Checking the weather for you!.”)
def weather_check():
print(“Looks great outside! Enjoy your trip.”)
print(“False Alarm, the weather changed! There is a thunderstorm approaching. Cancel your plans and stay inside.”)
weather_check()
This last question. I am stuck. I need urgent help. I cannot understand why I am unable to move on. The code comes out find but I cannot progress. Stuck. Any help is appreciated.
Hi #fareesa793, step 4 the two last print must be indented and step 5 you need to unindent the last print.
Hope is work for you.
Here is my final code:
print(“Checking the weather for you!”)
def weather_check():
print(“Looks great outside! Enjoy your trip.”)
print(“False Alarm, the weather changed! There is a thunderstorm approaching. Cancel your plans and stay inside.”)
It depends what you are printing. Is it literal text or numbers or are the values assigned to variables? Are you entering the print statement in the interactive shell or in a program?
Cannot advise what to use since I only use the Python shell. For working on projects it follows one will use the same environment as everyone else on the team (your collaborators).
In Python the rarely used/seen token is our favorite one from other languages, a semi-colon, which indicates end of statement, also means the same thing.
>>> print ('Hello World'); print()
Hello World
>>>
We can also use the newline character in our string:
For that step (step 3) I would recommend just copy and paste the text from the instruction directly. If you look closely False Alarm are both capitalized, which is not present in your code. It’s very unintuitive and probably missed by the devs if you were just typing out the message yourself.
Hope that helps you guys and anyone else that’s stuck on that exercise!
Copy paste it then rewrite it on your own sometimes it glitches so just delete the words and type them again and make sure that the only print that is indent is the 2nd one
here’s the code:
print(‘Checking the weather for you!’)
def weather_check():
print(‘Looks great outside! Enjoy your trip.’)
print(‘False Alarm, the weather changed! There is a thunderstorm approaching. Cancel your plans and stay inside.’)
For anyone else stuck on step 5:
1.) The “A” in “False Alarm,” is capitalized, as others have mentioned.
2.) If both strings are typed correctly, and you’ve unindented the 2nd print statement and it still doesn’t work, you may have to reset the workspace and type it out again. I’m not sure why, but this step was extremely finicky for me, and I had to type, retype, indent, unindent, multiple times until it finally worked.