Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

In Python, how do you make a subclass from a superclass?

1 Answer

0 votes
by (106k points)

To make a subclass from a superclass you can use the below-mentioned code:-

class Class1(object): 

pass 

class Class2(Class1): 

pass

Here Class2 is a sub-class of Class1.

Related questions

0 votes
1 answer
asked Jul 6, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer
0 votes
1 answer
0 votes
4 answers
0 votes
1 answer
asked Nov 26, 2020 in Python by ashely (50.2k points)

Browse Categories

...