-
Code testFunction = lambda n: {19:21}.get(n,n)
Test Cases import codewars_test as test # TODO Write tests import solution # or from solution import example # test.assert_equals(actual, expected, [optional] message) .describe("FixedCases") def fixedCases(): .it("One plus one") def testCase(): test.assert_equals(testFunction(1+1), 2) .it("nine plus ten") def testCase(): test.assert_equals(testFunction(9+10), 21)
Output:
-
Code testFunction = lambda n: 21 if n == 19 else n- testFunction = lambda n: {19:21}.get(n,n)
- 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 }}