The Python Game Book

code games. learn Python.

User Tools

Site Tools


en:glossary:a:any

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
en:glossary:a:any [2020/05/13 10:31]
horst
en:glossary:a:any [2020/05/13 10:32]
horst
Line 4: Line 4:
  
 <blockquote>Return True if any element of the iterable is true. If the iterable is empty, return False. Equivalent to: <blockquote>Return True if any element of the iterable is true. If the iterable is empty, return False. Equivalent to:
- +<code python; gutter=false> 
-  def any(iterable): +def any(iterable): 
-      for element in iterable: +    for element in iterable: 
-          if element: +        if element: 
-              return True +            return True 
-      return False+    return False 
 +</code>
 </blockquote> </blockquote>
              
en/glossary/a/any.txt · Last modified: 2020/05/13 10:36 by horst