Exercise files still contains solutions
Greetings,
I'm on the Introduction to Python Section 6's exercise for "conditional statements and functions together" sub-section and when I click on the exercise, I see solutions written under the exercise although I expect to see nothing but the exercise question itself. It was just the same in the previous exercise too.
This is a serious problem. Could you please fix all of the problems similar to this?
Kind regards,
Hi Hasan!
Thanks for reaching out.
Thank you very much for pointing this out. We have indeed just discussed this issue with a colleague. It will require an update of the Introduction to Python course that I hope within only a working day or two will be applied.
Hope this helps but please feel free to get back to us should you need further assistance. Thank you.
Best,
Martin
Hi Martin, thanks a lot.
Cheers
Hiii
I wanted to ask about the solution of the exercise, i noticed that you did it using print instead of return (you've said that when using a function we use return).
Thank you so much for your efforts.
Hi Maria!
Thanks for reaching out.
It all depends on the reason you are creating the given loop or function for. If the obtained value can (potentially) be used for further calculations, as is the case with the add_10(m)
function from the video lecture (https://learn.365datascience.com/courses/introduction-to-python/use-conditional-statements-and-functions-together/), then return
does a great job.
Otherwise, if all you want from the given loop/function is that Python displays a certain outcome for you, then print()
is the preferred choice, since it better shows your idea behind creating that loop.
Hope this helps.
Best,
Martin