Skip to content

Instantly share code, notes, and snippets.

@carcigenicate
Last active December 20, 2024 21:21
Show Gist options
  • Save carcigenicate/112784998733deb956a4d45d0e8fba5e to your computer and use it in GitHub Desktop.
Save carcigenicate/112784998733deb956a4d45d0e8fba5e to your computer and use it in GitHub Desktop.
class Question:
def __init__(self, question: str):
self.question = question
self.answer = None
questions = [
Question('This is question one'),
Question('This is question two'),
Question('This is question three'),
]
def quiz(qs: list[Question]) -> None:
for q in qs:
q.answer = input(q.question)
quiz(questions)
# questions now contains the answers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment