Commonly used built-in functions

There are a number of built-in functions that we will use throughout the book. The main ones are listed as follows:

  • str: The string function is used to convert any other type of data into a string.
  • int: The integer function is used to convert a string or float into an integer. To avoid an error, any string passed to the integer function must be a number such as '1'.
  • float: The float function is used to convert a string or an integer into a float, much like the integer function.