def sumd(arr): return sum(arr)
def sum(arr):result = 0for i in arr:result += ireturn result- def sumd(arr):
- return sum(arr)
import codewars_test as test # TODO Write tests from solution import sumd # test.assert_equals(actual, expected, [optional] message) @test.describe("Example tests") def test_group(): @test.it("Basic tests") def test_case(): test.assert_equals(sum([1]), 1) test.assert_equals(sum([1,2,3]), 6)
- import codewars_test as test
- # TODO Write tests
from solution import sum- from solution import sumd
- # test.assert_equals(actual, expected, [optional] message)
- @test.describe("Example tests")
- def test_group():
- @test.it("Basic tests")
- def test_case():
- test.assert_equals(sum([1]), 1)
- test.assert_equals(sum([1,2,3]), 6)