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/2000-July/006439.html below:

[Python-Dev] multi-loop quiz results

[Python-Dev] multi-loop quiz resultsThomas Wouters thomas@xs4all.net
Thu, 13 Jul 2000 23:07:00 +0200
On Thu, Jul 13, 2000 at 03:17:41PM -0400, Greg Wilson wrote:

> I gave 20+ grad students in computer engineering and computer science
> (plus a couple of profs) the questionnaire below.  A summary of
> results is:

> * Versions (D), (F), and (H) show that semi-colon separated targets
>   imply cross-product iteration, but 'and' and 'while' imply
>   simultaneous iteration.

Really ? Looking at it, it looks like 'while' also implies cross-product:

> (H)
> for x in [10, 20, 30] while y in [1, 2, 3]:     2       7       0       0       1       1
>     print x+y
> 
> (I)
> for x in [10, 20, 30] while y in [1, 2]:        0       1       0       7       2       1
>     print x+y


'and' does seem to be the 'right' thing, but mostly in the awkward
extra-grouped variant... Apparently using a builtin instead of a syntax
change is a good thing. Hopefully it will at least get people thinking,
instead of assuming.

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!



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