Tricky Areas in Python

Steve Holden steve at holdenweb.com
Mon Oct 24 20:55:41 CEST 2005


beza1e1 wrote:
> let me try.
> 
> 1) ''.join(lots_of_pieces)
> 
> 2) This doesn't even work, if something is removed, the list is too
> short. So:
> [x for x in somelist if not isbad(x)]
> well, list comprehension is Python 2.4 and 2.3 is the standard in many
> OSes, so it is possibly not the most portable solution
> I had to look up the syntax, because i never use it in my code, yet.

Python 2.2.1 (#1, Aug 25 2004, 16:56:05)
[GCC 2.95.4 20011002 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> [a.upper() for a in ['two', 'point', 'two']]
['TWO', 'POINT', 'TWO']
 >>>

> 
> 3+4) I never used property - had to look it up. So i learned something
> :)
> 
regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC                     www.holdenweb.com
PyCon TX 2006                  www.python.org/pycon/




More information about the Python-list mailing list