def hello_world(world): if world: return "Hello World baby" else: return "No World"
- def hello_world(world):
if world == True:- if world:
- return "Hello World baby"
elif world == False:- else:
- return "No World"
import codewars_test as test # TODO Write tests import solution # or from solution import example # test.assert_equals(actual, expected, [optional] message) @test.describe("Example") def test_group(): @test.it("True world case") def test_true(): test.assert_equals(hello_world(True), "Hello World baby") @test.it("False world case") def test_false(): test.assert_equals(hello_world(False), "No World")
- import codewars_test as test
- # TODO Write tests
- import solution # or from solution import example
- # test.assert_equals(actual, expected, [optional] message)
- @test.describe("Example")
- def test_group():
@test.it("test case")def test_case():test.assert_equals(1 + 1, 2)- @test.it("True world case")
- def test_true():
- test.assert_equals(hello_world(True), "Hello World baby")
- @test.it("False world case")
- def test_false():
- test.assert_equals(hello_world(False), "No World")