def makeQ(self):
shapes = ["Square", "Rectangle", "Triangle", "Octagon", "Pentagon", ]
shape = random.sample(shapes, 1)[0]
q1 = ("How many sides does a {0} have?").format(shape)
options = [3,4,8,5]
if shape == "Square" or shape =="Rectangle":
a1 = 4
elif shape == "Triangle":
a1 = 3
elif shape == "Octagon":
a1=8
elif shape =="Pentagon":
a1=5
print("Choose the correct answer: {0}").format(options)
return q1, a1, options
评论列表
文章目录