Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1.  
  2.  
  3.  
  4. def email_split(email_str):
  5. es = email_str.split("@")
  6. lead = str(es[0][0])
  7. last = str(es[0][-1])
  8. total = lead + '*****' + last + '@' + es[1]
  9. return total
  10.  
  11. def phone_split(phone_str):
  12. last_4 = phone_str[-4:]
  13. lead = phone_str[:-4]
  14.  
  15. mod_str = ""
  16. for i in lead:
  17. if i == '(' or i == ')':
  18. continue
  19. elif i in '0123456789':
  20. mod_str = mod_str + '*'
  21. else:
  22. mod_str = mod_str + i
  23.  
  24. return mod_str + last_4
  25.  
  26. print email_split("anton@email.com")
  27. print phone_split("617 755 5257")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement