ESEric Shinindevelopmentblog.hashnode.dev·Sep 22, 2021 · 1 min readBuilt-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 ...00
ESEric Shinindevelopmentblog.hashnode.dev·Sep 22, 2021 · 2 min readPacking 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 ...00
ESEric Shinindevelopmentblog.hashnode.dev·Sep 22, 2021 · 1 min readNamed 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...00
ESEric Shinindevelopmentblog.hashnode.dev·Sep 17, 2021 · 1 min readStatic 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...00
ESEric Shinindevelopmentblog.hashnode.dev·Sep 15, 2021 · 3 min readClass 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...00