text = ... {i:c for (i, c) in enumerate(text) if c.isupper()}Dict-Comprehension. The only change is the colon. In this case the keys are the indices and the values are the chars.
By the way,
...
is the Ellipsis
object. It's used for numpy.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!