Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Imported code is in the multiline comment
- """"
- class Question:
- def __init__(self, body, answer):
- self.body = body
- self.answer = answer
- """
- from Classes import Question
- questions = [
- "What is Alex's favourite color? \n(a) Black\n(b) Blue\n(c) Purple ",
- "What is Olga's favourite movie? \n(a) Home Alone\n(b) Shrek\n(c) Deadpool ",
- "what is Obama's last name? \n(a) Hillary\n(b) Obama\n(c) Michelle "
- ]
- questions = [
- Question(questions[0], "a"),
- Question(questions[1], "b"),
- Question(questions[2], "b"),
- ]
- def function(questions):
- score = 0
- for question in questions:
- answer = input(question.body)
- if answer == question.answer:
- score += 1
- print("You got " + str(score) + " / " + str(len(questions)))
- function(questions)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement