class 中国麻雀:
    def __init__(self, 飜,符):
        self.飜=飜
        self.符=符
    def 子計算(self):
        return ((self.飜*self.符*3) if (self.飜 > 7) else None)
    def 親計算(self):
        return ((self.飜*self.符*4) if (self.飜 > 7) else None)

class 日本麻雀(中国麻雀):
    def 子計算(self):
        return ((2**(self.飜+2)*self.符*4))
    def 親計算(self):
        return ((2**(self.飜+2)*self.符*6))
me = 中国麻雀(8,20)
print(me.子計算())
him = 日本麻雀(8,20)
print(him.子計算())

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: