Local tests work fine but , when i run it on codewars it shows an error

Viewed 22

i test some of the test cases locally from the tests in codewars and they work perfectly fine.

Link from question asked: https://www.codewars.com/kata/52597aa56021e91c93000cb0/train/python

   def move_zeros(lst):
        new_list = []
        get_zeros = []
        get_first_index = lst.index(0)
        for number in lst:
            if number >= 1:
                new_list.append(number)
            else:
                get_zeros.append(number)
        if get_first_index == 0:
            return new_list + get_zeros 
        else:
            return get_zeros + new_list 
    
    
    print(move_zeros([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 3, 9, 9, 9, 9]))
    print(move_zeros([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 1, 2, 1, 1, 3, 1, 9, 9]))
    print(move_zeros([1, 0, 1, 2, 0, 1, 3]))
    print(move_zeros([0, 0, 0, 0, 1, 2, 1, 1, 3, 1]))
    print(move_zeros([0, 0, 0, 0, 0, 9, 7]))
0 Answers
Related