ECS 32A Lecture 15: Functions
39 views2 pages
Verified Note
9 Feb 2019
School
Department
Course
Professor
ECS 32A verified notes
15/30View all
Document Summary
Things lke print() input() str() are all functions which do certain tasks when called upon. Python allows you to create your own functions as well. A function is a named series of statements written in a function definition. Return statement jumps back to the point in the program where the function was called. Functions save time and code in terms of retyping similar processes. Functions can also be used to pass information around your program. If you write good functions, you can share them with others by allowing them to import your module. In a function call, the caller gives a function arguments . In a function definition, the function tells us its parameters . In the following hello is an argument to the print() function: Return statement in a function is really important when you are returning a value. Python doesn"t determine if the values you are passing to a function call are.