Here is the code and im struggling to understand the line 5 and 6. I know how isupper() works but i cant understand the combinations going on.
def IndexWords(InputText):
words = 0
count = 2
for i in range(len(InputText)):
for word in InputText[i].split()[1:]:
CapitalizationCheck = list(word.strip(','))[0].isupper()
if CapitalizationCheck == True:
print('%s:%s' % (count,word))
words +=1
count += 1
count += 1
if words == 0:
print('None')
IndexWords(input().split('.'))
This code works just fine but there is too much going on in it(mybe too much for me)