#18 Classes and Objects with Example | Python Tutorial Series | In Tamil | EMC Academy

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

ความคิดเห็น • 39

  • @abarnasri24
    @abarnasri24 ปีที่แล้ว +5

    The way of our teaching is awesome please post many videos for python learners... Your teaching is becomes to easy understanding... Thankyou so much🎉

  • @rajeshmechdesire
    @rajeshmechdesire 10 หลายเดือนก่อน +13

    a = int(input("enter the first number: "))
    b = int(input("enter the second number: "))
    class cal:
    def __init__ (self,a,b):
    self.num1= a
    self.num2= b
    def add(self):
    print("add: ", self.num1+self.num2)
    def sub(self):
    print("Sub: ",self.num1-self.num2)
    def mul(self):
    print("Mult: ",self.num1*self.num2)
    def div(self):
    print("Div: ",self.num1/self.num2)
    obj = cal(a,b)
    obj.add()
    obj.sub()
    obj.mul()
    obj.div()

  • @Sivanithi_S
    @Sivanithi_S ปีที่แล้ว +3

    Excellent teaching bro ...I searched many videos for learning python...And I finally found that...Very much Tnx bro...

  • @suanarts6033
    @suanarts6033 5 หลายเดือนก่อน +4

    Bro, Really thanks a lot . Now I am using python in my office for automation. Your TH-cam course is help me a lot… once again thank you so much ❤❤❤❤❤

  • @selvabharathi4994
    @selvabharathi4994 6 หลายเดือนก่อน +2

    your video is useful of the python learners then easy to understand of the your videos

  • @c007-v8j
    @c007-v8j ปีที่แล้ว +2

    '''create Two variables a and b
    Create a function called add, sub, multiplication, or division all functions should take 2 variables as parameters
    Pass the a and b values through the object().
    '''
    class calculator:
    def __init__(self,a,b):
    self.first_value=a
    self.second_value=b
    def added(self):
    print(f"The value of first {self.first_value} and the second value {self.second_value} and the addition of first and second value : {self.first_value+ self.second_value}")
    def subtract(self):
    print(f"The value of first {self.first_value} and the second value {self.second_value} and the subtraction of first and second value : {self.first_value - self.second_value}")
    def multiptly(self):
    print(f"The value of first {self.first_value} and the second value {self.second_value} and the mutliplication of first and second value : {self.first_value * self.second_value}")
    def divi(self):
    print(f"The value of first {self.first_value} and the second value {self.second_value} and the division of first and second value : {self.first_value / self.second_value}")
    addition=calculator(3,4)
    addition.added()
    subtraction=calculator(12,34)
    subtraction.subtract()
    multiplication=calculator(4,67)
    multiplication.multiptly()
    division=calculator(36,6)
    division.divi()

  • @sivakumarkumar3581
    @sivakumarkumar3581 6 หลายเดือนก่อน

    Excellent teaching bro i understood😇

  • @Mano_2517
    @Mano_2517 ปีที่แล้ว +1

    create a class called calculator:
    class calculator:
    def __init__(self, h, n):
    self.num1=h
    self.num2=n
    def calc(self):
    print("Added: ", self.num1+self.num2)
    print("Subracted: ", self.num1-self.num2)
    print("Mutiplied: ", self.num1*self.num2)
    print("Divided: ", self.num1/self.num2)

    k=int(input("Enter 1st number: "))
    l=int(input("Enter 2nd number: "))
    total=calculator(k, l)
    total.calc()

  • @Just_learn-b3r
    @Just_learn-b3r 6 หลายเดือนก่อน

    Thalaiva... you are great ❤

  • @aarthimohan1310
    @aarthimohan1310 6 หลายเดือนก่อน +1

    videos la letters la clear ah terila bro,yr teaching is very good

  • @akashak2801
    @akashak2801 5 หลายเดือนก่อน

    class calculator :
    def __init__ (self,a,b):
    self.add=a+b
    self.sum=a-b
    self.mul=a*b
    self.div=a/b
    def display (self) :
    print(self.add)
    print(self.sum)
    print(self.mul)
    print(self.div)
    s1=calculator(10,5)
    s1.display()

  • @LokeshLokesh-ks4cr
    @LokeshLokesh-ks4cr ปีที่แล้ว

    Neega vera level bro

  • @farithh6830
    @farithh6830 3 หลายเดือนก่อน

    Q4:
    class calculator:
    def __init__(self,a,b):
    self.a=a
    self.b=b
    def add(self):
    print("Add = ",self.a+self.b)
    def sub(self):
    print("Sub = ",self.a-self.b)
    def multi(self):
    print("Multi = ",self.a*self.b)
    def divi(self):
    print("Divi = ",self.a/self.b)
    x=calculator(10,2)
    x.add()
    x.sub()
    x.multi()
    x.divi()
    Answer:
    Add = 12
    Sub = 8
    Multi = 20
    Divi = 5.0

  • @gajendranravichandran1670
    @gajendranravichandran1670 8 หลายเดือนก่อน

    #Q4 Create a class called calculator
    #Create 2 variables a and b
    #Create a function called add, sub, mul, div all functions should take 2 variables as parameter
    #Pass the a and b value through object
    class calculator:
    def __init__(self,a,b):
    self.a=a
    self.b=b

    def add(self):
    sum= self.a+self.b
    print("Sum is ", sum)
    def sub(self):
    diff= self.a-self.b
    print("Difference is ", diff)
    def mul(self):
    prod= self.a*self.b
    print("Product is ", prod)
    def div(self):
    div= self.a/self.b
    print("Division is ", div)
    num1= int(input("Enter the first value : "))
    num2= int(input("Enter the second value : "))
    calci=calculator(num1, num2)
    calci.add()
    calci.sub()
    calci.mul()
    calci.div()

  • @c007-v8j
    @c007-v8j ปีที่แล้ว

    '''5)create a class called teacher
    Create a variable = name and registry number using constructor.
    Create a function called display which should display the name and registry number of the teacher
    Create t1 and t2 object and pass the name and reg no value through object.
    '''
    class teacher:
    def __init__(self,name,registry): #arguments or variables
    self.real_name=name #class instance
    self.register_number=registry
    def display(self):
    print(f"The Teacher name is {self.real_name} and his/her registered number is {self.register_number}")
    #created a object pass the arguments
    t1=teacher("LALLY","9523")
    t1.display()
    print("
    ")
    t2=teacher("swathi","9056")
    t2.display()

  • @LokeshLokesh-ks4cr
    @LokeshLokesh-ks4cr ปีที่แล้ว +3

    Html and css upload panuga

  • @Ady_NXT
    @Ady_NXT 3 หลายเดือนก่อน +1

    Bro short ah explain pannunga romba deep ah poguthu

  • @arulventhan641
    @arulventhan641 7 หลายเดือนก่อน

    Thank you brother

  • @arunhhh333
    @arunhhh333 ปีที่แล้ว

    class Calculator:
    def __init__(self,a,b):
    self.a=a
    self.b=b
    def add(self):
    print("Add",self.a+self.b)
    def sub(self):
    print("Sub",self.a-self.b)
    def mul(self):
    print("Mul",self.a*self.b)
    def div(self):
    print("Div",self.a/self.b)
    num=Calculator(2,4)
    num.add()
    num.sub()
    num.mul()
    num.div()

  • @intothespace.....9442
    @intothespace.....9442 8 หลายเดือนก่อน

    super

  • @dhachchav2703
    @dhachchav2703 5 หลายเดือนก่อน

    num1=int(input("Enter the first number: "))
    num2=int(input("Enter the sec number: "))
    class calculator:
    def __init__(self,num1,num2):
    self.add=num1+num2
    self.sub=num1-num2
    self.mul=num1*num2
    self.div=num1/num2
    def display(self):
    print("Addition: ",self.add)
    print("Subraction: ",self.sub)
    print("Multiplication: ",self.mul)
    print("Division: ",self.div)

    sum1=calculator(num1,num2)
    sum1.display()

  • @nabelas1393
    @nabelas1393 ปีที่แล้ว +2

    class Fruit:
    def __int__(self):
    self.color = "red"
    apple = Fruit()
    print(apple.color)
    AttributeError: 'Fruit' object has no attribute 'color'
    please explain

    • @JrJs-cg7gu
      @JrJs-cg7gu ปีที่แล้ว

      Innoru function create pannanum pro athu ulla print la kodukanum

    • @Ashkaran-cr5le
      @Ashkaran-cr5le 9 หลายเดือนก่อน

      def __init__(self): right
      def __int__(self): wrong

    • @subavoice44
      @subavoice44 6 หลายเดือนก่อน

      int is wrong ❌
      init is correct ✅

  • @subashsmiles5447
    @subashsmiles5447 7 หลายเดือนก่อน

    Pause&Play: class calculator:
    def __init__(self,a,b):
    self.a=a
    self.b=b
    def add(self):
    result=self.a + self.b
    print('Addtion is :', result)
    def sub(self):
    result=self.a - self.b
    print('Subtraction is :', result)
    def mul(self):
    result=self.a * self.b
    print('Multiplication is :', result)
    def div(self):
    result=self.a / self.b
    print('Division is :', result)
    user=calculator(5,6)
    user.add()
    user.sub()
    user.mul()
    user.div()

  • @SunderasanManivel
    @SunderasanManivel 2 หลายเดือนก่อน

    Bro it is right or wrong
    class calculator():
    def __init__(self,a,b):
    self.add=a+b
    self.sub=a-b
    self.mul=a*b
    self.div=a/b
    def display (self):
    print("addition:",self.add)
    print("subract:",self.sub)
    print("multiple:",self.mul)
    print("division:",self.div)
    operate=calculator(int(input()),int(input()))
    operate.display()

  • @nanthininanthini9742
    @nanthininanthini9742 ปีที่แล้ว

    Ithula user ta irunthu input vangi atha epadi intha object vachi function kulla call panrathu bro

  • @yogesh.7909
    @yogesh.7909 ปีที่แล้ว

    bro i have one doubt class name need to follow the pascal case ?? is it necessary because in your videos your not using that in class name

  • @selvabharathi4994
    @selvabharathi4994 6 หลายเดือนก่อน

    enum extra python new new information solunga

  • @nishayadav1458
    @nishayadav1458 ปีที่แล้ว

    It is showing error for me if I gave parameter

  • @tnpscasp1771
    @tnpscasp1771 ปีที่แล้ว +1

    Python na yenna bro

    • @logeshs2135
      @logeshs2135 ปีที่แล้ว +5

      Athu oru type of snake bro Amazon kaatla irukum😌

    • @kamalbharathi4thstda936
      @kamalbharathi4thstda936 6 หลายเดือนก่อน

      Python is a programming language which is used to communicate with computer and there are many programming languages like Java,c++, HTML etc..

  • @subashsmiles5447
    @subashsmiles5447 7 หลายเดือนก่อน

    Pause&Play: class teacher:
    def __init__(self,name,reg):
    self.name=name
    self.registernumber=reg
    def display(self):
    print("Name:",self.name)
    print("registernumber: ", self.registernumber)
    t1=teacher("Rohit",1)
    t2=teacher("Sam",2)
    t1.display()
    t2.display()