ECS 32A Lecture 15: Functions

39 views2 pages
Verified Note

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.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions