© Valentina Porcu 2018
Valentina PorcuPython for Data Mining Quick Syntax Referencehttps://doi.org/10.1007/978-1-4842-4113-4_4

4. Functions

Valentina Porcu1 
(1)
Nuoro, Italy
 

An object-based programming language is structured around two major concepts: objects and functions. An object is everything we create in a work session using a programming language such as Python. Functions allow us to assign one or more actions to these objects. Let’s learn how to create a function.

Some words about functions in Python

With Python, we basically have two types of functions:
  1. 1.

    The built-in functions that are part of Python and are loaded automatically when we run Python

     
  2. 2.

    The functions we can build and use (user defined)

     

A function is a piece of code that performs ...

Get Python for Data Mining Quick Syntax Reference 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.