Last active
December 20, 2024 21:21
-
-
Save carcigenicate/112784998733deb956a4d45d0e8fba5e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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