Professional Documents
Culture Documents
Computer Programming ENEE 101: Lec#17 (Sequences Part 3)
Computer Programming ENEE 101: Lec#17 (Sequences Part 3)
ENEE 101
This part of
memory is
marked as
free
Proper ways:
2
Passing lists to functions 1/3
Example
Lists are mutable objects (like all objects). Simple variables are not mutable.
Output
3
Passing lists to functions 2/3
Output
lst remains in memory although is not accessible outside the function add.
list1, list2, list4 will share the same id which is the id of lst. 4
Passing lists to functions 3/3
Problem solved
Output
Initialization
required
As we know for
variables
list2 is:
[6, 5, 4, 3, 2, 1]
6
Multidimensional lists - Intro
7
Two-dimensional lists
8
Create and print a matrix
This example creates the matrix row by row:
123
456
789
9
Operation Examples
10
Sorting Example
11