Built-in functions / commands for ListsWhy Lists? There are many data types in python and each of them has a unique trait. Like dictionaries, specialized in storing specific data under specific names, tuples, which are immutable, sets, which can sort out the commonalities between another ...Sep 22, 2021 · 1 min readdevelopmentblog.hashnode.dev
Packing and Unpacking AdvancedWhy pack/unpack? args and *args are used A LOT in functions. Not only packing but unpacking certain data types in functions and using them is really helpful. For instance, let's say that function A requires 30 variables. Without unpacking, you would ...Sep 22, 2021 · 2 min readdevelopmentblog.hashnode.dev
Named TuplesImport from collections import namedtuple Declarations Point1 = namedtuple('Point', ['x', 'y']) Point2 = namedtuple('Point', 'x, y') Point3 = namedtuple('Point', 'x y') Point4 = namedtuple('Point', 'x y x class', rename=True) # Default = False Creati...Sep 22, 2021 · 1 min readdevelopmentblog.hashnode.dev
Static Methods - TutorialWhat are static methods? Static Methods are methods that are not limited to a class, but at the same time cannot directly access other class functions(methods) or variables. Since they are not associated with an instance, They can be very flexible. B...Sep 17, 2021 · 1 min readdevelopmentblog.hashnode.dev
Class Functions and Class VariablesClass Variables Class variables are variables that stay within the class. It's basically a variable you'll need in using a function. Calling class Vector: vector_count = 0 value = 1.5 def __init__(self, *args): ''' Crea...Sep 15, 2021 · 3 min readdevelopmentblog.hashnode.dev