def __init__(self,question,answer):
self.question=question
self.answer=answer
questions=[
"Question1:who is the most cool guy in the world?\na.i don't know\nb.me\nc.WRY",
"Question2:whch of them is absolutely OOP?\na.python\nb.C\nc.Java",
"Question3.1+1=?\na.0\nb.2\nc.i don't know"
]
list= []
list.append( questionslist(questions[0],'c') )
list.append( questionslist(questions[1],'c') )
list.append( questionslist(questions[2],'b') )
score=0
iput='a'
for cnt in list:
iput=input(cnt.question)
if iput==cnt.answer:
score=score+1
print("hey,guy,you get "+str(score)+" points in all")
if score==3:
print("you are so smart!")
if score==2:
print("Not bad!")
if score==1:
print("Come on!")
if score==0:
print("BYE")
所有的代码都在类中?缺少main来创建类对象。