You just need to loop through the list and when the condition in question is true, increment the count by one - this is where count +=1 will be needed. It's the same as count = count + 1. If you still have problems, I can provide with full solution.
--
You received this message because you are subscribed to the Google Groups "Python GCU Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-gcu-for...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thank you for the timely answer. That really put me on the right path. Can you please take a look at what I've done so far and let me know if I have the right idea?
for word in words:c = 0
# length is 2 or more
if len(word) >= 2:
# first and last char in the word are the same
if word[0] == word[-1]:c += 1return c
--
You received this message because you are subscribed to the Google Groups "Python GCU Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-gcu-for...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.