On Tue, Apr 17, 2012 at 5:03 AM, Chinesekidz <chinesek...@googlemail.com> wrote: > Hello! > > I would like to know how to write the program to count the total > number of strings (in the list) used in Python.. > > for example: > [broken example snipped] > in the case above, it is to show the how many times of strings from > the list has been used... > > I would like to know how to write the code for this...
Your request is a little unclear, and your example code doesn't do what you think it does. What exactly do you mean by the number of times the string has been used? What makes the loop "use" a string more than once? With your given iteration, it will always loop over the elements exactly once. Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list