-
Code def sum_of_numbers(a, b): return a + b
Test Cases import codewars_test as test # Import Codewars test framework .describe("Sum of Numbers Tests") def test_group(): .it("Basic Test Cases") def basic_tests(): test.assert_equals(sum_of_numbers(1, 2), 3) test.assert_equals(sum_of_numbers(-1, 1), 0) test.assert_equals(sum_of_numbers(0, 0), 0) test.assert_equals(sum_of_numbers(100, 200), 300) test.assert_equals(sum_of_numbers(-50, -50), -100)
Output:
-
Code function sum_of_numbers(a, b)return b + aend- def sum_of_numbers(a, b):
- return a + b
Test Cases -- TODO: Replace examples and use TDD by writing your own testslocal solution = require 'solution'describe("solution", function()it("test for something", function()assert.are.same(2, sum_of_numbers(1,1))end)end)- import codewars_test as test # Import Codewars test framework
- @test.describe("Sum of Numbers Tests")
- def test_group():
- @test.it("Basic Test Cases")
- def basic_tests():
- test.assert_equals(sum_of_numbers(1, 2), 3)
- test.assert_equals(sum_of_numbers(-1, 1), 0)
- test.assert_equals(sum_of_numbers(0, 0), 0)
- test.assert_equals(sum_of_numbers(100, 200), 300)
- test.assert_equals(sum_of_numbers(-50, -50), -100)
- All
- {{group.name}} ({{group.count}})
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}