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,480 points
44 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
• 3,170 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
123 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
113 views
0 votes
0 answers

What does super() do in python?

How does it help in multiple inheritance? READ MORE

Sep 5 in Python by Waseem
• 4,480 points
42 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,720 points
68 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 399 views
0 votes
1 answer
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
• 3,170 points
32 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
• 3,170 points
61 views