Solving  - ValueError: slice step cannot be zero