#built in function
a=8
b=8
c=sum((a,b)) #ctrl and click sum then see function doctype
print(c)
#user defined function
def function1():
print("i am function 1")
function1() #just print korbe
print(function1())#return value soho print korbe
#function with input
def fun2(a,b):
print(a+b)
fun2(4,4)
#function thekereturn chaile
def fun3(a,b):
"""this is a normal finction"""
# docstring function ar vetro a right neom a likhte hobe noile error dakhabe
avarage=(a+b)/2
print(avarage)
return avarage
v=fun3(5,7)
print(v)
#docstring show kore je aita kisher function ki kaj er function
print(fun3.__doc__)
Comments
Post a Comment