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
На этой странице сайта вы можете посмотреть видео онлайн Python getattr Function длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Jakubication 18 Март 2026, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 68 раз и оно понравилось 0 зрителям. Приятного просмотра!