Section 3.11 Glossary
Glossary Glossary
- collection data type.
- A data type in which the values are made up of components, or elements, that are themselves values.
- default value.
- The value given to an optional parameter if no argument for it is provided in the function call.
- dot notation.
- Use of the dot operator,
.
, to access functions inside a module, or to access methods and attributes of an object. - immutable data type.
- A data type whose values cannot be changed. Modifying functions create a totally new object that does not change the original one.
- index.
- A variable or value used to select a member of an ordered collection, such as a character from a string, or an element from a list.
- indexing (
[]
). - Access a single character in a string using its position (starting from 0). Example:
'This'[2]
evaluates to'i'
. - length.
- Number of characters in a string. It can be found by (
len
) function Example:len('happy')
evaluates to5
. - optional parameter.
- A parameter written in a function header with an assignment to a default value which it will receive if no corresponding argument is given for it in the function call.
- slice.
- A part of a string (substring) specified by a range of indices. More generally, a subsequence of any sequence type in Python can be created using the slice operator (
sequence[start:stop]
). Example:'bananas and cream'[3:6]
evaluates toana
(so does'bananas and cream'[1:4]
). - whitespace.
- Any of the characters that move the cursor without printing visible characters. The constant
string.whitespace
contains all the white-space characters.
You have attempted of activities on this page.