list
A list is a ordered, mutable (can change data) collection of data.
tuple
A tuple is a ordered, immutable (can not change data) collection of data.
set
A set is a unordered collection of unique elements.
dict
A dictionary dict is a unordered collection of key-value pairs.
Data Structures: Exercises
Compute the mean of the data list.
Create a 3 \times 3 identity matrix I as a list of lists.
A student has a dictionary of short notes for three courses. Compute the total number of characters across all notes using the formula:
\text{Total Characters} = \sum (\text{length of each string})
Two points are represented as tuples u and v. Compute the Euclidean distance between the points using the formula:
\| \mathbf{u} - \mathbf{v} \|_2 = \sqrt{ \sum_{i=1}^n (u_i - v_i)^2 }
Compute the range of the data list.