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)

No comments:

Post a Comment

python class topic video