forked from Tooruchan/Telegram-CAPTCHA-bot-pyrogram
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchallenge_test.py
40 lines (33 loc) · 937 Bytes
/
challenge_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import random
questions = {
"A": {
"question":
"(厦门大学)对于一个具有N个顶点的图,若采用邻接矩阵表示,则该矩阵的大小为:\nA. N\nB. (N-1)^2\nC .(N+1)^2\nD. N^2",
"choices": [
"A",
"B",
"C",
"D",
],
"answer": 'D'
}
}
class Challenge:
def __init__(self):
self._question = None
self._ans = None
self._choices = []
self.new()
def new(self):
question = random.choice(list(questions))
self._question = questions[question]
self._choices = self._question["choices"]
self._ans = self._question["answer"]
def __str__(self):
return "{qus}".format(qus=self._question['question'])
def qus(self):
return self.__str__()
def ans(self):
return self._ans
def choices(self):
return self._choices