The dir( ) Function :
The dir( ) built-in function returns a sorted list of strings containing the names defined by or contained in a module.
The dir( ) Function :
The dir( ) built-in function returns a sorted list of strings containing the names defined by or contained in a module.
Simply, a module is a file consisting of Python code. A module can define functions, classes, and variables. A module can also include runnable code.
Built into the python interpreter are a number of functions which are a piece of code that carry out specific operations and returns the result of those operations.
List comprehension is basically short hand for creating list. It is used to derive a new list from an existing list.
The slice operator is a way to get items from lists, as well as change them.The process--
a list is given named list1 so to slice it we use slice operator.