built in functions in python


  • Python provides a number of important built-in functions that we can use without needing to provide the function definition.
  • The creators of Python wrote a set of functions to solve common problems and included them in Python for us to use.
  • The max and min functions give us the largest and smallest values in a list, respectively:
  • >>> max('Crazy Tutorial Point')
    'z'
    >>> min('Crazy Tutorial Point')
    ' '
    >>> 
  • The max function tells us the “largest character” in the string (which turns out to be the letter “z”) and the min function shows us the smallest character (which turns out to be a space).
  • Another very common built-in function is the len function which tells us how many items are in its argument. If the argument to len is a string, it returns the number of characters in the string.
  • >>> len('Crazy Tutorial Point')
    20
    >>> 
  • Here is a list of Phyton’s built-in functions:
  • abs() all() any() ascii()
    bytearray() bytes() bin() bool()
    callable() chr() classmethod() compile()
    complex() delattr() dict() dir()
    divmod() enumerate() eval() exec()
    filter() float() format() frozenset()
    getattr() globals() hasattr() hash()
    help() hex() id() __import__()
    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()