A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-May/015134.html below:

[Python-Dev] Iteration variables and list comprehensions

[Python-Dev] Iteration variables and list comprehensions [Python-Dev] Iteration variables and list comprehensionsGreg Ewing greg@cosc.canterbury.ac.nz
Thu, 31 May 2001 17:16:11 +1200 (NZST)
Tim:

> >>> base3 = [x[:] for x[0] in digits for x[1] in digits for x[2] in
>              digits]

Yikes! That would be clearer as

  [[x,y,z] for x in digits for y in digits for z in digits]

I'll concede it's nowhere near as much fun, though...

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4