Code "return lst[1:] == lst[:-1]" will compare two lists:
1st example: [2, 3, 4, 5, 6] and [1, 2, 3, 4, 5] because lst[1:] = [2, 3, 4, 5, 6] and lst[:-1] = [1, 2, 3, 4, 5]
2nd example: [1, 1, 1] and [1, 1, 1]
We have to compare current and next elements of list in cycle (for i in lst), while result is True.
What does your PR belong to?
[ ] Website
Snippets
[ ] General / Things regarding the repository (like CI Integration)
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[ ] Enhancement (non-breaking improvement of a snippet)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[ ] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[ ] I have checked that the changes are working properly
[ ] I have checked that there isn't any PR doing the same
Description
Code "return lst[1:] == lst[:-1]" will compare two lists:
1st example: [2, 3, 4, 5, 6] and [1, 2, 3, 4, 5] because lst[1:] = [2, 3, 4, 5, 6] and lst[:-1] = [1, 2, 3, 4, 5]
2nd example: [1, 1, 1] and [1, 1, 1] We have to compare current and next elements of list in cycle (for i in lst), while result is True.
What does your PR belong to?
Types of changes
Checklist: