Use of functions with example ds301222

Function is a block of code and used when it is required .
It runs only when it is called.
It can return data as a result.

Example:
def fun():
print(“this is function”)

Calling a function will be like :
def fun():
print(“hai”)

fun()

Function with arguments:
def person(name):
print(“hai” + name)

person(“sia”)
person(“kinn”)

1 Like

Very good :fire: keep learning