Answer to Question #290865 in Programming & Computer Science for Angelie Suarez

Question #290865

class QuizBrain:

def __init__(self, q_list):

self.question_number = 0

self.question_list = q_list


def still_has_question(self):

if self.question_number < len(self.question_list):

return True

else:

False


def next_question(self):

current_question = self.question_list[self.question_number]

self.question_number += 1

user_answer = input(f"Q.{self.question_number}: {current_question.text} (True/False):")

self.check_answer(user_answer, current_question.answer)


def check_answer(self, user_answer, correct_answer):

if user_answer.lower() == correct_answer.lower():

print("You got this right!")

else:

print("That's wrong")

print(f"The correct answer was: {correct_answer}")


add a score:

sample output:

Your Score is 1/1


1
Expert's answer
2022-01-28T07:10:44-0500
Dear Angelie Suarez, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS