Python getattr Function

Publié le: 18 mars 2026
sur la chaîne: Jakubication
68
0

This video teaches the Python getattr function. It starts off by showing how its functionality is identical to using dot notation to access an object's given attribute directly. It then goes on to show how the two functionalities differ. First, by showing being able to access an object's attribute dynamically, via a string, instead of typing out the attribute name directly. Next, as a consequence of the previous one, being able to loop through a list of attributes. Finally, it shows off geattr's optional third argument that allows you to check for an attribute that doesn't exist, and not get an AttributeError.

Sections
0:00 - Intro & Setup
0:37 - String Attribute
1:02 - Loop Through Attributes
1:34 - Check For Attributes That Don't Exist

#python #codingtutorial #learntocode


Sur cette page du site, vous pouvez voir la vidéo en ligne Python getattr Function durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Jakubication 18 mars 2026, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 68 fois et il a aimé 0 téléspectateurs. Bon visionnage!