Guest User

Untitled

a guest
Jan 23rd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. "PiE" would have an out put of [0, 2]
  2.  
  3. "HaH" has an output of [0,0]
  4.  
  5. import re
  6.  
  7. pattern = re.compile(r'^[A-Zd]+$')
  8. elemList = []
  9.  
  10. def capitals(word):
  11. pattern.match(word)
  12. for w in word:
  13. if w != w.lower():
  14. a = word.index(w)
  15. elemList.append(a)
  16. return elemList
Add Comment
Please, Sign In to add comment