#Shorts #Python
Python tips and tricks:
Sometimes we want to create classes that serve no other purpose than to pass in some data between the functions. Python allows us to reduce the amount of code we write to do that by using the namedtuple. We don't need to define a class in its standard way that consists of an _init_ method and have to assign all the passed in properties to the instance. Instead, we can do all of that in one line with the namedtuple.
-------------------------------------------------------------------------------------
Links:
Blog: https://evgenyurubkov.com
Twitter: / evgenyurubkov
Instagram: / evgenyurubkov
Youtube: / @codevev