variables in string.count

ntg85 ntg85 at verizon.net
Fri Jun 4 02:01:12 EDT 2004


Can you use variables in string.count or string.find? I tried, and
IDLE gives me errors.
Here's the code:
while list:
    print 
    letter = raw_input("What letter? ")
    string.lower(letter)
    guess = string.count(letter, list)
    if guess == -1:
        print "Try again!"
    else:
        list.remove(letter)
the error is:
TypeError: expected a character buffer object
Thanks.



More information about the Python-list mailing list