In python whats difference between default constructor and no parameter constructor

0 votes

In python what's the difference between default constructor and no parameter constructor?

Oct 6, 2020 in Python by anonymous
• 10,500 points
267 views

1 answer to this question.

0 votes

The default constructor is called when there is no init() method in the class, in default constructor we cannot assign values to data members.

If we write init(self) in the class with only "self" as parameter then it is no parameter constructor, here we can assign values to data members like
"self.x = 10"

answered Oct 6, 2020 by Gitika
• 65,850 points

Related Questions In Python

+1 vote
1 answer

What's the difference between eval, exec, and compile in Python?

exec is not an expression: a statement ...READ MORE

answered Aug 28, 2018 in Python by Priyaj
• 58,080 points
3,398 views
0 votes
2 answers

What's the difference between %s and %d in Python string formatting?

The reason is that they are using ...READ MORE

answered Feb 8 in Python by Rahul
• 8,980 points
30 views
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
5,607 views
+1 vote
1 answer

What is the difference between range and xrange functions in Python 2.X?

xrange only stores the range params and ...READ MORE

answered Aug 22, 2018 in Python by Priyaj
• 58,080 points
1,504 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,816 views
0 votes
1 answer
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
2,092 views
0 votes
5 answers
+1 vote
2 answers

What is the difference between .py and .pyc files in Python?

Hi, @Roshni, You can follow a few steps ...READ MORE

answered Jun 23, 2020 in Python by Gitika
• 65,850 points
14,219 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP