SHARE
TWEET

Untitled

a guest Jul 17th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def mask_3rd(s):
  2.     if len(s) < 2: return s
  3.     s2 = s.replace(s[2], "*")
  4.     return s2[0] +s2[1] +s[2] +s2[3:]
  5.  
  6. print(mask_3rd("logging"))
  7. print(mask_3rd("apple"))
  8. print(mask_3rd("orange"))
  9. print(mask_3rd("gooooogle"))
  10. print(mask_3rd("i"))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top