Jul-21-2019, 05:09 PM
Hello again!
I'm trying to return a list of all the indexes in the string that have capital letters.
I'm trying to return a list of all the indexes in the string that have capital letters.
lista =[]
def capital_letters(arg):
for i in arg:
if i.isupper():
#place the capital letters in the list
return lista
print(capital_letters('tZtTtT'))I tried:lista.append(i)but it return only the first capital letter in the string.
