Move History

Rooted by: Strings in Lists
Fork Selected
  • Code
    def print_String():
        return lst.reverse()
        
    Test Cases
    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)
    
  • Code
    • def print_String():
    • # Printing the index of a string in the list.
    • lst = ['double', 'switch', 'off', 'on', 'jump']
    • print(lst.index('double'))
    • # Reversing the items in the list
    • print('Reversed List:',lst[::-1])
    • return lst.reverse()
    Test Cases
    • 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.assert_equals(1+1,2)