Skip to content

Instantly share code, notes, and snippets.

@WindyNova
Created July 9, 2024 11:47
Show Gist options
  • Select an option

  • Save WindyNova/59001bbf09a3e52ba72f5d8c7c7b26c4 to your computer and use it in GitHub Desktop.

Select an option

Save WindyNova/59001bbf09a3e52ba72f5d8c7c7b26c4 to your computer and use it in GitHub Desktop.
Python Metaprogramming Hello World
class Person:
def __init__(self, **kwargs):
for key, value in kwargs.items():
setattr(self, key, value)
person = Person(name="Alice", age=30, job="Engineer")
print(f"Name: {person.name}, Age: {person.age}, Job: {person.job}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment