string.join question
Mark McEahern
marklists at mceahern.com
Wed Oct 2 23:19:20 EDT 2002
> 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