Quiz Catalog

Catalog of quizzes

class Student:
  marks = 10
  name = 'Vanya'


person = Student()

name, marks = getattr(person, 'name'), getattr(person, 'marks')

print(name, marks)
Roma
  • build-in/getattr
  • class