Notas
Functions
Conteúdo das notas (1)
Página 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
Informações
- Descrição
- An Introduction to Interactive Programming in Python (Week 1 - Functions, logic, conditionals) Notas sobre Functions, criado por asderel em 29-04-2013.
- Criado por
- asderel · abr 2013
- Atualizado
- 15 set 2016
- Visualizações
- 53
- Tags
- Avaliação