Advertisement
MaxDvc

removeLetter_removeNumber

Nov 14th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. def removeLetters(string):
  2. #@param:
  3. # string: string;
  4. # return: string;
  5. s = ""
  6. for i in string:
  7. if not i.isalpha():
  8. s = s + i
  9. return s
  10. #-------------------------------------------------------------------------------
  11. def removeNumbers(string):
  12. #@param:
  13. # string: string;
  14. # return: string;
  15. s = ""
  16. for i in string:
  17. if not i.isdigit():
  18. s = s + i
  19. return s
  20. #-------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement