Say for example I have the following string:
Hello
And my job is to shift all the letters over by however many spots I am told to, and lets say it is 1, so the result would be:
elloH
But my program returns it as
elloh
What I want to know is, how can I get a list with the indices of where a capital letter is, so I can make the letters at that same spot in the new string uppercase?
I think you would do it by converting the String to a list through list(string)
and then iterate through the list so, and whenever the item in the list returns true
for isUpper()
, then store the index of that in a list. I just am not able to write it in python.