Wednesday, January 20, 2021

python class 21 ...topic classes

 # -*- coding: utf-8 -*-

"""

python topic classes

@author: anil



from substraction import sub


def addition(a,b):

    return a+b


a=sub(10,5)

print(a)



class addition():

   def __init__(self):

       print("praveen is thopu")

    


addition()




class addition():

   def __init__(self):

       print("praveen is thopu")

       print("praveen is thopu")

       print("praveen is thopu")

       print("praveen is thopu")

       print("praveen is thopu")

       print("praveen is thopu")

       print("praveen is thopu")

    


addition()



class addition():

   def __init__(raju):

       print("praveen is thopu")

       print("praveen is thopu")

       print("praveen is thopu")

       print("praveen is thopu")

       print("praveen is thopu")

       print("praveen is thopu")

       print("praveen is thopu")

    


addition()


class addition():

   def __init__(self):

       a=10

       b=20

       c= a+b

       print(c)

    


addition(10,20)


class addition():

   def __init__(self):

       print("this is default constructor")

      

   def addition():

       #c= a+b

       #print(c)

       print("this is addition method")

       

   def sub():

       #c= a+b

       #print(c)

       print("this is sub method")

    


addition()

addition.addition()

addition.sub()

"""

class addition():

   def __init__(self):

       print("this is default constructor")

      

   def add(a,b):

       c= a+b

       print(c)

       #print("this is addition method")

       

   def sub(a,b):

       c= a-b

       print(c)

       #print("this is sub method")

    



addition.add(10,20)

#add(10,20)

python day 20 revision on all topics

 # -*- coding: utf-8 -*-

"""


 python day 20

@author: anil


for i in range(1,100,1):

     print(i)

     


fruits=["dragon","mango","apple"]

print(type(fruits))

print(fruits[0])

print(fruits[1])

print(fruits[2])




pra1={'key1':10,

      'key2':{'key3':23},

      

      }

print(type(pra1))

print(pra1['key2']['key3'])



def basha(a,b):

    #print("rajini is the boss",a+b)

    return a+b



if __name__ == "__main__":

    s=basha(3,4)

    print(s)


    s=basha(300,400)

    print(s)

    

"""

def basha(a,b,*s,**kw):

    return s


s=basha(4,5,7)

print(s)

    





     



python class topic video