
class_body = """
def __init__(self, name, age):
    self.name = name
    self.age = age

def description(self):
    return f'{self.name} is {self.age} years old'

def speak(self, sound):
    return f'{self.name} says {sound}'
"""

class_namespace = {}

exec(class_body, globals(), class_namespace)
Dog = type('Dog', (), class_namespace)

curt = Dog("Curt", 4)
print(curt.name)
print(curt.age)
print(curt.description())
print(curt.speak('Wo'))
print(curt.speak('Bow'))
print(isinstance(curt, Dog))

