class cube: 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
def cube(a, b, c):#your code herereturn a*b*c#return 0- class cube:
- 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
import codewars_test as test # TODO Write tests from solution import cube # test.assert_equals(actual, expected, [optional] message) @test.describe("Example") def test_group(): @test.it("test case") def test_case(): test.assert_equals(cube(7, 9, 4).volume(), 252) test.assert_equals(cube(5, 12, 7).volume(), 420) test.assert_equals(cube(3, 7, 49).volume(), 1029)
- import codewars_test as test
- # TODO Write tests
- from solution import cube
- # test.assert_equals(actual, expected, [optional] message)
- @test.describe("Example")
- def test_group():
- @test.it("test case")
- def test_case():
test.assert_equals(cube(7, 9, 4), 252)test.assert_equals(cube(5, 12, 7), 420)test.assert_equals(cube(3, 7, 49), 1029)- test.assert_equals(cube(7, 9, 4).volume(), 252)
- test.assert_equals(cube(5, 12, 7).volume(), 420)
- test.assert_equals(cube(3, 7, 49).volume(), 1029)