Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def debugging_simple(elements: list, max_size: int) -> list:
- """
- Remove every string from list, which is longer than maximum allowed size.
- This is a broken function. You have to find out how is it broken by using PyCharm's debugging tool.
- :param elements: List of strings
- :param max_size: Maximum allowed size
- :return: List of elements that are shorter than max_size
- """
- elements_to_remove = []
- for element in elements:
- if len(element) > max_size:
- elements.remove(element)
- return elements
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement