Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Virochaan Ravi6,940 Points
how do you skip
HOW do I skip the function.
# Code goes here
If i understand your question correctly then by "SKIP the function" maybe you meant to terminate the execution of the program at a certain point.
If so, lets consider it this way.
control doesn't reaches here.
no matter what you write here
what's written after return is not processed once the return statement is reached in a function.
In above code, the function returns certain value, so to end the execution we make it return something and control doesn't passes through it.
Now, but what if a function returns "nothing", so make it stop executing further we can return "nothing"
def function(argument, or_no_argument):
Hope i understood your question correctly and this helps! if not please comment so.