Advertisement
UniQuet0p1

Untitled

Oct 7th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. def debugging_simple(elements: list, max_size: int) -> list:
  2. """
  3. Remove every string from list, which is longer than maximum allowed size.
  4.  
  5. This is a broken function. You have to find out how is it broken by using PyCharm's debugging tool.
  6.  
  7. :param elements: List of strings
  8. :param max_size: Maximum allowed size
  9. :return: List of elements that are shorter than max_size
  10. """
  11. elements_to_remove = []
  12. for element in elements:
  13. if len(element) > max_size:
  14. elements.remove(element)
  15. return elements
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement