Difference between constructor and method

0 votes
Can you please tell what is the difference between a constructor and a method?
4 days ago in Python by Fata
• 1,000 points
9 views

1 answer to this question.

0 votes

Method: It a function which is the member of a class. Methods consists of statements that may or may not return an output. 

Constructor:  It is a special type of method that has the same name the class name. These methods are used to initialize an object's state.

answered 4 days ago by Wajiha
• 1,840 points

Related Questions In Python

0 votes
1 answer

What's the difference in Qt between setVisible, setShown and show/hide

show() is just a convenience function for ...READ MORE

answered Apr 17, 2018 in Python by anonymous
818 views
0 votes
1 answer

What is the difference between list and tuple?

Lists are mutable(values can be changed) whereas ...READ MORE

answered May 4, 2018 in Python by aayushi
• 750 points
1,372 views
0 votes
1 answer

Difference between '==' and 'is'

'==' checks for the equality of the ...READ MORE

answered May 14, 2018 in Python by Nietzsche's daemon
• 4,260 points
21 views
0 votes
1 answer

Difference between pop and delete methods

I think you mean del() and not ...READ MORE

answered Jun 25, 2018 in Python by Hamartia's Mask
• 1,580 points
28 views
+1 vote
2 answers

What is the difference between classes and labels in machine learning?

Classes and Labels both are almost same things ...READ MORE

answered Apr 3 in Python by SA
• 1,030 points
91 views
0 votes
1 answer

What is the difference between Python and IPython?

There are few differences between Python and ...READ MORE

answered Jul 26, 2018 in Python by Priyaj
• 56,200 points
266 views
0 votes
1 answer

Difference between del, remove and pop on lists

es, remove removes the first matching value, ...READ MORE

answered Aug 1, 2018 in Python by Priyaj
• 56,200 points
21 views
0 votes
1 answer

What is the difference between re.search and re.match?

The theoritical approach can be this way, re.match is ...READ MORE

answered Aug 10, 2018 in Python by Priyaj
• 56,200 points
433 views
0 votes
1 answer

Difference between function and generator?

Normal Functions vs Generator Functions: Generators in Python ...READ MORE

answered Jul 15 in Python by Wajiha
• 1,840 points
30 views
0 votes
1 answer

Difference between ElementTree and Minidom

Python allows parsing these XML documents using ...READ MORE

answered Jul 22 in Python by Wajiha
• 1,840 points
51 views