Answer: Exam block #4: Data Collections – Lists, Tuples, and Dictionaries (23%) Total Question-: 7 • Simple lists: o Constructing vectors o Indexing and slicing o The len() function • lists in detail: o indexing o slicing o basic methods (append(),insert(),index()) and functions (len(),sorted() etc.) o Del instruction o Iterating lists with the for loop o Initializing o in and not in operators o list comprehension o copying and cloning • lists in lists: matrices and cubes • tuples: indexing, slicing, building, immutability • tuples vs. lists: similarities and differences, lists inside tuples and tuples inside lists • dictionaries: building, indexing, adding and removing keys, iterating through dictionaries as well as their keys and values, checking key existence, keys(), items() and values() methods • strings in detail: escaping using the character, quotes and apostrophes inside strings, multiline strings, basic string functions.
Exam block #5: Functions (20%) Total Question-: 6 • Defining and invoking your own functions and generators • return and yield keywords, returning results, • the None keyword, • recursion • parameters vs. arguments, • positional keyword and mixed argument passing, • default parameter values • converting generator objects into lists using the list() function • name scopes, name hiding (shadowing), the global keyword |