Skip to content

Instantly share code, notes, and snippets.

View IvanFrecia's full-sized avatar

Ivan Frecia IvanFrecia

View GitHub Profile
@IvanFrecia
IvanFrecia / Function_Basics.py
Last active April 29, 2021 22:37
Coursera Python 3 Programming Specialization - Course 2 - Week 3 - Function Basics - 12.5. Returning a value from a function
# Let’s start by creating a very simple mathematical function that we will call square.
# The square function will take one number as a parameter and return the result of squaring that number.
# Here is the black-box diagram with the Python code following.
def square(x):
y = x * x
return y
toSquare = 10
result = square(toSquare)