Friday, December 18, 2020

python day13 functions

 '''


day 13

topic: functions


syntax:

    

    def funtion_name():

        statements

     



def addition():

    pass



addition()



def addition():

    print("this is basha")



for i in range(100):

    addition()

    print(i)


def addition():

    print("this is basha")



while(1):

    addition()


def addition():

    

    print("addition")

    print("addition")

    print("addition")

    print("addition")

    print("addition")




addition()



def addition():

    for i in range(100):

        print("addition",i)

   


addition()


def addition():

    while(1):

        print("addition")

   


addition()

 

def addition(i,j):

    print("addition",i+j)

    print("addition",i-j)

    print("addition",i*j)

   



i,j=3,4

addition(i,j)


def addition(j=6,i=5):

    print(i)

    print("addition",i+j)

    print("addition",i-j)

    print("addition",i*j)

   

addition(6,)



'''


def power_fn(x):

    result=x*x

    #print(result)

    return result


a=1

a=power_fn(2)

print(a)

No comments:

Post a Comment

python class topic video