En Sun, 11 Feb 2007 00:48:57 -0300, Jia Lu <[EMAIL PROTECTED]> escribió:
> I have a program that can telnet to a host. > But I cannot understand from [for c in data] part, can anyone explain > it to me? data is the received string. The for statement is used to iterate over a sequence; a string is considered a sequence of characters, so it iterates over all the characters in the string, one by one. py> data = "Hello" py> for c in data: ... print c, ord(c) ... H 72 e 101 l 108 l 108 o 111 py> -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list