#Python Python 101 : Ways of printing a dictionary values. For example, we have the below dictionary " d ". We could print the values of our dictionary , using the below code: Or by using this variation: March 10, 2023 Share
#Python Python 101 : The "Enum" object Enum is python object that represents a group of variables that are assigned a constant value. Below is a simple example - we need to include the " March 08, 2023 Share
#Python Python 101 : Breaking out of a "while" loop - while ... else - We could use the " while ... else " construct to break out of a " while " loop as soon as a condition is fulfilled. In the below exampl March 05, 2023 Share
#Python Python 101 : Mutables a default parameters to functions. When we pass a mutable default argument to a function - here the __init__() funtion - , that accepts a list, changing the default mutable argument will a March 01, 2023 Share
#Python Python 101 : __slots__ and data management. For classes with small, simple data, we could save memory by using the __slots__ attribute to the class. For example the Car class below: With __slots_ February 13, 2023 Share
#Python Python 101 : Decorators with parameters - passing arguments to a decorator - We could use decorators with parameters for example to control the flow of the execution of a decorator as we can see below: As we can see above, we co February 06, 2023 Share
#Python Python 101 : Changing the behavior of the "range()" function We create an custom iterator function that we will use with a " for " loop: We use it as below: The " yield " function acts as a return January 30, 2023 Share
#Python Python 101 : Reading text from a file The below example reads input from the " /home/albert/file " file and prints it: We use " StopIteration " exception to exit a loop so i January 24, 2023 Share