Advertisement
UniQuet0p1

Untitled

Sep 27th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. !!!!!!!!!!!!!!!!HELP PLS!!!!!!!!!!!!!!!!!!!!!
  2.  
  3. Filter letters
  4. Create a function filter_letters ().
  5. The input of the function is a list, which can consist of both numbers and letters.
  6. 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.
  7. The order of the letters in the filtered list must remain the same as in the original list.
  8. NB! The isalpha () method could be used in this task.
  9.  
  10. print(filter_letters(["x", "y"])) # --> ["x", "y"]
  11. print(filter_letters([1, "a", "3"])) # --> ["a"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement