/python-functions

First steps using functions in Python

Primary LanguagePython

Python Functions 🐍

A function is a reusable block of code that executes a certain functionality when it is called.

In Python, you define a function with the def keyword, then write the function identifier (name) followed by parentheses and a colon.

  def my_function():
      # What to make the function do

To call this function, write the name of the function followed by parentheses:

  my_function()
  1. Creating a Function
  2. Arguments in Functions
  3. Default Parameter
  4. Return Values