UrbanPro

Learn Python Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What does "self" mean in python class? Why do we need it?

Asked by Last Modified  

Follow 1
Answer

Please enter your answer

Imagine a situation. You stay in a big home with family members cosy and comfortabily (Class in Programming world). Now here comes your American born cousin for a visit, He does not know what is where, How everything works in your home. Your cousin wants to perform some activites (Call some functions...
read more

Imagine a situation.

You stay in a big home with family members cosy and comfortabily (Class in Programming world). Now here comes your American born cousin for a visit, He does not know what is where, How everything works in your home.

Your cousin wants to perform some activites  (Call some functions in Programming world).

1. Wants to go out in Car.

2. Wants to cook.

You are always with him and ensure all the necessity are there so that he can perform all these activites.

You always that guiding force that helps him.

YOU in this case is that "self" object.

Similarly in Python class, when a member function is called by an instance of that class.

Function which is being called has a reference to itself called SELF which can access the member variables and other member function through the SELF.

So every member function in class when called has invisible SELF object which points to current calling object.

In the same way You cousin is able to do all the activities with the help of you.

 

For more details and deeper python programming constructs, Join my classes.

Santosh

read less
Comments

Related Questions

What is a Python development, UGI, Data science and Machine learning? Do they all include Python or are they different? Which is better to learn for making a career?

Python development is a field in which you develop real world applications using the Python programming language. UGI stands for Upper Gastrointestinal and it is a concept in human body. Data Science is...
Srinu
How can I easily learn Python?
UrbanPro does not allow naming a website in answer so I have to write in this way. 'sololearnDOTcom/Course/python' is the website you can follow for easily learning python3. Its like playing a game over there.
Aditi
0 0
6
Hi all, I'm looking for a tutor who can teach Data Structure, and also Object Oriented Programming w.r.t Python.
Hi, I'm a professional trainer and design consultant, and I do training on Python, AWS, C/C++. I do generally customize the training content and pace based on the student's absorbption level. I have trained...
Jigar

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Personalise touch of training & learning
We all are in countinous learning phase in life. Day to day we are learning new things,new language words,new faces,new gazets by all means of modes like reading books,newspapers,watching TV,movies,meeting...
S

Smartnub Softsolutions

0 0
0

Steps of Execution of a Python Program
When we compile a Python program, the python compiler converts the Python source code into another code called byte code. Byte code is a fixed set of instructions that represent different types of operations....


Why Python
Python can be used in any futuristics technology A= Analytics Data Science Artificial Intelligence(AI) Neural Network(NN) Natural Language Processing(NLP) Computer Vision(OpenCV) In Analytics...

Built-In Functions (Python)
Built-in Functions: The Python interpreter has a number of functions built into it that are always available. They are listed here in alphabetical order. Built-in Functions abs() divmod() input() open() staticmethod() all() enumerate() int() ord() str() any() eval() isinstance() pow() sum() basestring() execfile() issubclass() print() super() bin() file() iter() property() tuple() bool() filter() len() range() type() bytearray() float() list() raw_input() unichr() callable() format() locals() reduce() unicode() chr() frozenset() long() reload() vars() classmethod() getattr() map() repr() xrange() cmp() globals() max() reversed() zip() compile() hasattr() memoryview() round() __import__() complex() hash() min() set() ...

Recommended Articles

Python is one of the most popular programming languages in the world. It is general-purpose, object oriented, high-level programming language used in a number of programming fields. Python is a great programming language to learn as it will introduce you to the world of programming. If you are from the technical background...

Read full article >

Business Process outsourcing (BPO) services can be considered as a kind of outsourcing which involves subletting of specific functions associated with any business to a third party service provider. BPO is usually administered as a cost-saving procedure for functions which an organization needs but does not rely upon to...

Read full article >

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Looking for Python Training classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for Python Training Classes?

The best tutors for Python Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Python Training with the Best Tutors

The best Tutors for Python Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more