Python Built In Functions

  • input(): Reads a line of text from the user through the console.
  • type(): Returns the type of an object.
  • str(): Converts an object to a string.
  • int(): Converts a number or a string to an integer.
  • float(): Converts a number or a string to a floating-point number.
  • list(): Converts an iterable to a list.
  • dict(): Creates a new dictionary or converts an iterable of key-value pairs to a dictionary.
  • set(): Creates a new set or converts an iterable to a set.
  • tuple(): Converts an iterable to a tuple.
  • bool(): Converts a value to a Boolean (True or False).
  • max(): Returns the highest value among the arguments or in an iterable.
  • min(): Returns the lowest value among the arguments or in an iterable.
  • sum(): Returns the sum of all elements in an iterable.
  • abs(): Returns the absolute value of a number.
  • round(): Rounds a number to a specified number of decimal places.
  • sorted(): Returns a new sorted list from the elements of an iterable.
  • open(): Opens a file and returns a file object.
  • input(): Reads a line of text from the user through the console.
  • range(): Generates a sequence of numbers within a specified range.
  • zip(): Combines two or more iterables element-wise.
  • enumerate(): Returns an enumerate object, containing pairs of index and element.
  • map(): Applies a function to all items in an input list and returns an iterator.
  • filter(): Filters elements of an iterable based on a function.
  • sum(): Returns the sum of all elements in an iterable.
  • any(): Returns True if at least one element of an iterable is True.
  • all(): Returns True if all elements of an iterable are True.
  • id(): Returns the identity (memory address) of an object.
  • help(): Displays information about an object, module, or keyword.

Popular posts from this blog

len() Function Python

Scope and Trends of Python in 2024

Loops in Python - Mastering While and For Loops