Create a function meaning_of_life
that calculates the "Answer to the Ultimate Question of Life, the Universe, and Everything."
As calculated by an enormous supercomputer named Deep Thought over a period of 7.5 million years, in "The Hitchhiker's Guide to the Galaxy" by Douglas Adams.
def meaning_of_life_is(*args): return 42;
meaning_of_life_is=lambda:6*7- def meaning_of_life_is(*args): return 42;
import codewars_test as test from solution import meaning_of_life_is # or from solution import example @test.describe("Answer to the Ultimate Question of Life, the Universe, and Everything.") def test_group(): @test.it("life having is 42") def test_case(): test.assert_equals(meaning_of_life_is("hapiness", "fulfillment"), 42) @test.it("life wanting is also 42") def test_case(): test.assert_equals(meaning_of_life_is(None), 42)
- import codewars_test as test
# TODO Write tests- from solution import meaning_of_life_is # or from solution import example
# test.assert_equals(actual, expected, [optional] message)@test.describe("Example")- @test.describe("Answer to the Ultimate Question of Life, the Universe, and Everything.")
- def test_group():
@test.it("test case")- @test.it("life having is 42")
- def test_case():
- test.assert_equals(meaning_of_life_is("hapiness", "fulfillment"), 42)
- @test.it("life wanting is also 42")
- def test_case():
test.assert_not_equals(meaning_of_life_is(), None)- test.assert_equals(meaning_of_life_is(None), 42)