What does super() function do in python?

0 votes
How do we use it in single inheritance in python?
Jul 16 in Python by Waseem
• 4,160 points
15 views

1 answer to this question.

0 votes

Super function calls the parent class method directly from the child class in python.

class Parent():
def func():
print("this is function 1")
class Child(Parent): 
def func1():
print("this is function 2")
super.func()


ob = Child()
ob.func1()
answered Aug 2 by Mohammad
• 2,820 points

Related Questions In Python

0 votes
1 answer

What does the random.triangular(low, high, mode) function do in python?

It returns a random floating point number ...READ MORE

answered May 27 in Python by Vinod
40 views
0 votes
1 answer

What does numpy.reshape() function do in python?

numpy.reshape() gives a new shape to an ...READ MORE

answered May 29 in Python by Kyraa
45 views
0 votes
1 answer

What does ' -> ' mean in Python function definitions?

It's a function annotation. In more detail, Python 2.x ...READ MORE

answered May 22, 2018 in Python by charlie_brown
• 7,710 points
47 views
0 votes
1 answer

What does eval() in Python do?

The eval function lets a Python program ...READ MORE

answered Aug 24, 2018 in Python by Priyaj
• 56,200 points
39 views
+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 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 168 views
+4 votes
6 answers
0 votes
1 answer

What does the dir() function do in python?

The dir() function returns all properties and methods of ...READ MORE

answered Aug 6 in Python by Mohammad
• 2,820 points
15 views
0 votes
1 answer

what does a conditional operator in python do?

Conditional operators in python is same as ...READ MORE

answered May 2 in Python by Mohammad
• 2,820 points
36 views