8- Functions

Play this article

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


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

# Hello from Python for researchers tutorial!

A function with an argument:

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

# Anas Azad Othman Rasul
# Aviar Azad Othman Rasul
# 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