Check if Python object has attribute 🐍 #shorts

preview_player
Показать описание
How do you check if a Python object has a given attribute? Use the built-in function hasattr( object, 'attribute_name'), passing in object and the attribute name as a string.
Рекомендации по теме