[Tutor] some problem, please help me

Markzer lupchinskileonardo at gmail.com
Thu May 28 14:44:23 EDT 2020


-------------- next part --------------
from pythonclass import Question
question_prompts =[
    "What is the name of the creator of the program?\n(a) Joaquin\n(b) Gabriel\n(c) Leonardo\n(d) All others are incorrect\n\n",
    "What is the favorite color of the creator?\n(a) Blue\n(b) Gray\n(c) Yellow\n(d) White\n\n",
    "How old is the creator?\n(a) 15 (b) 16 (c)13 (d) 14\n\n"
]
questions = [
    Question(question_prompts[0], "c"),
    Question(question_prompts[1], "a"),
    Question(question_prompts[2], "d")
]



def run_test(questions):
    score = 0
    for question in questions:
        answer = input(question.prompt)
    if answer == question.answer:
        score += 1
    print("You got " + str(score) + "/" + str(len(questions)) + " Correct")


run_test(questions)


More information about the Tutor mailing list