Notizen
Functions
Inhalt der Notizen (1)
Seite 1
Functions — Functions
Functions are reusable pieces of programs that take an input and produce an output.
A function definition is a compound statement consisting of a header and a body.
The header includes the keyword def, a sequence of parameters enclosed by parentheses, followed by a colon :.
The body consists of a sequence of statements, all indented by 4 spaces.
Functions may return a value using the keyword return or have a side effect (e.g., print).
To evaluate a function call, replace the function's parameters in the body of the function by their associated values in the call and execute the body of the function.
Lecture examples - Functions
More examples - Stucture of Functions, Uses of Functions, Scope of Variables, Examples of Functions
Página Nueva
Informationen
- Beschreibung
- An Introduction to Interactive Programming in Python (Week 1 - Functions, logic, conditionals) Notiz am Functions, erstellt von asderel am 29/04/2013.
- Erstellt von
- asderel
- Aufrufe
- 53
- Tags
- Bewertung