8- Functions

8- Functions

A function is a block of code that allows us to reuse the same code whenever we call it.

function2.png

def my_function():
    print("Hello from Python for researchers tutorial!")

my_function()
# Hello from Python for researchers tutorial!

A function with an argument:

def function1(fname):
    print(fname + " Azad Othman Rasul")

function1("Anas")
# Anas Azad Othman Rasul
function1("Aviar")
# Aviar Azad Othman Rasul
function1("Muhammad")
# Muhammad Azad Othman Rasul

If you find this content helpful, please consider SUBSCRIBING to my channel for future updates.

If you would like to get the full video tutorial and a certificate, you can enroll in the course by following this link: https://www.udemy.com/course/python-for-researchers/?referralCode=886CCF5C552567F1C4E7