Content deleted Content added
m Dating comment by Dblanchard - "Seeking help understanding the Python prime number generator code." |
→Python primes generator contributed by banned user: Python expression explanation |
||
Line 205:
: I agree, the quality of the content overrules the character of the contributor. However, the Python example's prime number generator is beyond me. In particular, the line "if not any( n % f == 0 for f in p ):" uses the variable "f" which is never created in the code. Any help?
[[User:Dblanchard|dblanchard]] ([[User talk:Dblanchard|talk]]) <span style="font-size: smaller;" class="autosigned">—Preceding [[Wikipedia:Signatures|undated]] comment added 16:22, 5 October 2009 (UTC).</span><!--Template:Undated--> <!--Autosigned by SineBot-->
::Hi, the code within the brackets of the call to <code>any</code> is itself a generator expression. It iterates through p, the list of primes so far, assigning each to f and returns the value of <code>n %f == 0</code> for each iteration.So it could be read colloquially as:<br> "''if there are not any instances of a multiple of already found primes in n''"<br> --[[User:Paddy3118|Paddy]] ([[User talk:Paddy3118|talk]]) 17:06, 5 October 2009 (UTC)
==Fuzzy definition?==
|