3Packages and Builtin Functions
We have discussed packages without really describing what they are so let's look at packages and how it sits within the general setup of Python. As mentioned previously, Python is object orientated which means that everything is an object, you'll get to understand this in practice, however there are a few important builtin functions which aren't objects and they are worth mentioning here as they will be used within the book. These builtin types will be used throughout the book so keep an eye out for them. Below we show some useful ones, for a full list refer to https://docs.python.org/3/library/functions.html.
- dir(): This function takes in an object and returns the _dir_() of that object giving us the attributes of the object.
- float(): Returns a floating point number from an integer of string
- int(): Returns an integer from a float of string
- len(): Returns the length of an object
- list(): Creates a list from the argument given
- max(): Gives ...
Get The Python Book now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.