#100DaysOfWeb in Python Transcripts
Chapter: Appendix: Python language concepts
Lecture: Concept: Calling functions
Login or
purchase this course
to watch this video and the rest of the course contents.
0:01
Functions are reusable blocks of functionality. And of course, they play an absolutely central role in Python.
0:08
Now, in Python we can have functions that are just stand alone, isolated functions, and these are quite common,
0:14
or we can have functions bound to classes and objects that bind together specific data about an object along with those behaviors,
0:22
we call those methods. The way we define them, interact with them, is basically the same, regardless whether they are functions or methods.
0:29
Here you can see we have a main method, we want to call it, it takes no parameters, and returns nothing or nothing that we care about,
0:36
so we just say main open close parenthese, like so, we can also call functions that take arguments,
0:41
here is a function called input, and it gathers input from the user, on the consoles,
0:45
it will give them a prompt, and this argument we are passing here is a string, and this is the prompt to share to the user,
0:51
pauses the input on the console and waits for them to type something and hit enter, when they do, the return value comes back
0:58
and is stored in this new variable called "saying".