Question.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:PokeMath 作者: rdp1070 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号