Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "PiE" would have an out put of [0, 2]
- "HaH" has an output of [0,0]
- import re
- pattern = re.compile(r'^[A-Zd]+$')
- elemList = []
- def capitals(word):
- pattern.match(word)
- for w in word:
- if w != w.lower():
- a = word.index(w)
- elemList.append(a)
- return elemList
Add Comment
Please, Sign In to add comment