Fundamentals
convert an integer into a string if possible,
otherwise return 0
import codewars_test as test # TODO Write tests import solution # or from solution import example # test.assert_equals(actual, expected, [optional] message) # TODO2 x is not defined in the test cases @test.describe("convert") def convert(): @test.it("") def test_case(): test.assert_equals(x('2'), 2) def test_case(): test.assert_equals(x('@'),0)
- import codewars_test as test
- # TODO Write tests
- import solution # or from solution import example
- # test.assert_equals(actual, expected, [optional] message)
- # TODO2 x is not defined in the test cases
- @test.describe("convert")
- def convert():
- @test.it("")
- def test_case():
- test.assert_equals(x('2'), 2)
- def test_case():
- test.assert_equals(x('@'),0)