Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inheritance
#5
I was just reading this thread to answer it and a question raised in my mind(learning python as well) that,

we can call eat() like this
Animal().eat()
but why we can't call eat() like this
Animal.eat()
why do we need to pass self
Animal.eat(self)
Reply


Messages In This Thread
Inheritance - by Athul - Aug-09-2018, 08:03 AM
RE: Inheritance - by ichabod801 - Aug-09-2018, 12:54 PM
RE: Inheritance - by micseydel - Aug-09-2018, 06:24 PM
RE: Inheritance - by Athul - Aug-11-2018, 07:35 AM
RE: Inheritance - by yksingh1097 - Aug-11-2018, 09:37 AM
RE: Inheritance - by snippsat - Aug-11-2018, 10:23 AM
RE: Inheritance - by ichabod801 - Aug-11-2018, 12:47 PM
RE: Inheritance - by yksingh1097 - Aug-11-2018, 06:48 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020