Im new to python and i need some help with this.
TASK : given a list --> words = [\'aba\', \'xyz\', \'xgx\', \'dssd\', \'sdjh\']
words = [\'aba\', \'xyz\', \'xgx\', \'dssd\', \'sdjh\']
i need to com
c=0 words = ['challa','reddy','challa'] for idx, word in enumerate(words): if idx==0: firstword=word print(firstword) elif idx == len(words)-1: lastword=word print(lastword) if firstword==lastword: c=c+1 print(c)