Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Python 3.6.0
- def mask_3rd(strings):
- if len(strings) <= 3:
- return strings
- char = strings[2]
- result = ''
- index = 0
- for s in strings:
- if index != 2 and s == char:
- result = result + '*'
- else:
- result = result + s
- index = index + 1
- return result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement