Copyright (c) Hyperion Entertainment and contributors.

Difference between revisions of "AmigaOS Manual: Python Functions"

From AmigaOS Documentation Wiki
Jump to navigation Jump to search
Line 23: Line 23:
 
</syntaxhighlight>
 
</syntaxhighlight>
   
== any ==
+
== any() ==
  +
  +
  +
<nowiki>any(iterable)</nowiki>
  +
  +
Return True if any element of the iterable is true. If the iterable is empty, return False. Equivalent to:
  +
  +
<syntaxhighlight lang="python">
  +
def any(iterable):
  +
for element in iterable:
  +
if element:
  +
return True
  +
return False
  +
</syntaxhighlight>
  +
 
== ascii ==
 
== ascii ==
 
== bin ==
 
== bin ==

Revision as of 13:54, 15 July 2018

Built-in Functions Reference

__import__

abs()

abs(number)

Return the absolute value of a number. The argument may be an integer or a floating point number. If the argument is a complex number, its magnitude is returned.

all()

all(iterable)

Return True if all elements of the iterable are true (or if the iterable is empty). Equivalent to:

def all(iterable):
    for element in iterable:
        if not element:
            return False
    return True

any()

any(iterable)

Return True if any element of the iterable is true. If the iterable is empty, return False. Equivalent to:

def any(iterable):
    for element in iterable:
        if element:
            return True
    return False

ascii

bin

bool

breakpoint

bytearray

bytes

callable

chr

classmethod

compile

complex

delattr

dict

dir

divmod

enumerate

eval

exec

filter

float

format

frozenset

getattr

globals

hasattr

hash

help

hex

id

input

int

isinstance

issubclass

iter

len

list

locals

map

max

memoryview

min

next

object

oct

open

ord

pow

print

property

range

repr

reversed

round

set

setattr

slice

sorted

staticmethod

str

sum

super

tuple

type

vars

zip