Newbie help understanding...

cmpython at gmail.com cmpython at gmail.com
Sat May 26 19:20:32 EDT 2007


The problem is that in your function t is a string (one of the cards
in the list called "cards") and strings don't have the ability to use
the append method.  But lists do.  Therefore t.append is wrong but
cards.append works fine.  (Append means "take the list you have and
add what is in the parenthesis to it...so cards.append("Ace") would
append the string Ace to the list of cards).




More information about the Python-list mailing list