# Question
class Question:
def __init__(self, texs, choices, answer):
self.texs = texs
self.choices = choices
self.answer = answer
def checkAmswer(self, answer):
return self.answer == answer
# print(q1.checkAmswer("python"))
# print(q1.checkAmswer("C#"))
# Quiz
class Quiz:
def __init__(self, questions):
self.questions = questions
self.score = 0
self.scoreIndex = 2
def getQuestion(self, index):
return self.questions[index]
def questionDisplay(self):
question = self.getQuestion()
q1 = Question("en iyi programlama dili hangisidir ?" , ["C#" , "python" , "javascrip" , "java"], "python")
q2 = Question("en popüler programlama dili hangisidir ?" , ["python" , "javascrip", "C#", "java"], "python")
q3 = Question("en çok kazandıran programlama dili hangisidir ?" , ["C#" , "javascrip" , "java", "python"], "python")
questions = [q1,q2,q3]
print(Quiz(questions).getQuestion(2).texs)