What does super() function do in python?

0 votes
How do we use it in single inheritance in python?
Jul 16, 2019 in Python by Waseem
• 4,530 points
80 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, 2019 by Mohammad
• 3,230 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, 2019 in Python by Vinod
343 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, 2019 in Python by Kyraa
189 views
0 votes
0 answers

What does super() do in python?

How does it help in multiple inheritance? READ MORE

Sep 5, 2019 in Python by Waseem
• 4,530 points
66 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,770 points
135 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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,081 views
0 votes
0 answers
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, 2019 in Python by Mohammad
• 3,230 points
53 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, 2019 in Python by Mohammad
• 3,230 points
107 views