Advertisement
UniQuet0p1

Untitled

Oct 5th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. def list_no_start_and_end(list_of_things: list) -> list:
  2. """
  3. Remove first and last element of a list and return the new list.
  4.  
  5. ["cat", "dog", "human"] -> ["dog"]
  6.  
  7. :param list_of_things: list
  8. :return: List without first and last element
  9. """
  10. del list_of_things[-1], list_of_things[0]
  11. return list_of_things
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement