Advertisement
WupEly

Untitled

Dec 18th, 2022
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. import sys
  2.  
  3. a = sys.stdin.read().split()
  4.  
  5. s = []
  6. to_print = []
  7. ab = "!#$%&'()*+,-./:;<=>?@[]^_`{|}~"
  8. for i, v in enumerate(a):
  9. for p in ab:
  10. v = v.replace(p, "")
  11. if v[0] == v[0].upper() and v not in s:
  12. s.append(v)
  13. to_print.append((i, v))
  14.  
  15. to_print = sorted(to_print, key= lambda x: x[1])
  16. for index, value in to_print:
  17. print(f"{index} - {value}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement