Ad

A cube consists of squares. You would only need one side's length.

Code
Diff
  • class cuboid:
        def __init__(self, a, b, c):
            self.a = a
            self.b = b
            self.c = c
            
        def volume(self):
            return self.a*self.b*self.c
    • class cube:
    • class cuboid:
    • def __init__(self, a, b, c):
    • self.a = a
    • self.b = b
    • self.c = c
    • def volume(self):
    • return self.a*self.b*self.c