Azad Rasul
SmartRS

SmartRS

8- Functions

Azad Rasul's photo
Azad Rasul

Published on Jun 27, 2021

1 min read

Subscribe to my newsletter and never miss my upcoming articles

Functions allowing us to use the same function whenever we call it.

function2.png

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

my_function()
# 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
 
Share this
Proudly part of