string.join question

andy surany mongo57a at comcast.net
Thu Oct 3 00:56:05 EDT 2002


Thanks. Got enough here to keep me busy for awhile....

-----Original Message-----
From: Mark McEahern <marklists at mceahern.com>
To: andy surany <mongo57a at comcast.net>
Cc: Python <python-list at python.org>
Date: Wednesday, October 02, 2002 11:19 PM
Subject: RE: string.join question


>> Hmmmm.... I'm going to have to figure this out.
>> I can test for a ' or " and respond with an invalid entry remark (which
it
>> would be...).
>
>  one_possible_likely_value = """He said, "I don't think you really want to
>omit quotation marks, do you?" """
>
><wink>
>
>> I'm ok with everything except the statement:
>> ([quote(v) for v in values])
>
>Did you notice the function quote() I supplied?
>
>  new_list = [func(x) for x in seq]
>
>is called a list comprehension.  It's just a different way to write this:
>
>  new_list = []
>  for x in seq:
>    new_list.append(func(x))
>
>Please reply to the list, by the way, since this is all on topic and others
>may have more to contribute.
>
>Cheers,
>
>// mark
>





More information about the Python-list mailing list