Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !!!!!!!!!!!!!!!!HELP PLS!!!!!!!!!!!!!!!!!!!!!
- Filter letters
- Create a function filter_letters ().
- The input of the function is a list, which can consist of both numbers and letters.
- The function must return a new list whose elements are all the letters in the input list. If no such letters are found, an empty list is returned.
- The order of the letters in the filtered list must remain the same as in the original list.
- NB! The isalpha () method could be used in this task.
- print(filter_letters(["x", "y"])) # --> ["x", "y"]
- print(filter_letters([1, "a", "3"])) # --> ["a"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement