Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- a = sys.stdin.read().split()
- s = []
- to_print = []
- ab = "!#$%&'()*+,-./:;<=>?@[]^_`{|}~"
- for i, v in enumerate(a):
- for p in ab:
- v = v.replace(p, "")
- if v[0] == v[0].upper() and v not in s:
- s.append(v)
- to_print.append((i, v))
- to_print = sorted(to_print, key= lambda x: x[1])
- for index, value in to_print:
- print(f"{index} - {value}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement