Python Hasattribut
hasattr(object, name)
Smoggy Squirrel
hasattr(object, name)
class Student:
name = 'John'
age = 23
student = Student()
print('Does student has name?: ', hasattr(student, 'name'))
print('Does student has marks?: ', hasattr(student, 'marks'))
# Output:
# Does student has name?: True
# Does student has marks?: False