Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Python Basics!
You have completed Python Basics!
Preview
You can return values from your function, let's explore how to do that.
Learn more
- Python Standard Library (Don't get overwhelmed! There's a bunch of stuff waiting for you to use!)
- Python Docs - math module
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
it actually gives you a value back.
0:00
In our case it gave us the number
of characters in our string.
0:00
Another example is when I call
the upper method on a string,
0:03
it created us a new string and
returned it.
0:06
Remember methods are really
just owned functions,
0:09
our string owns that function upper.
0:12
So another great feature of functions is
you can take some arguments, process them,
0:15
and then return a value to
the caller of your function.
0:19
So let's create a function
that returns a value.
0:22
Let's see, I know,
0:24
there are about a thousand apps
that do something similar to this.
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up