---
title: "How to Access Child-class Methods from Parent-class in Python"
description: "You can access child methods from the parent. The example shows a real-time scenario, and it's helpful for interviews."
url: https://srinimf.com/2022/09/06/how-to-access-child-class-methods-from-parent-class-in-python/
date: 2022-09-06
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2022/09/pexels-photo-8067800.jpeg?fit=1880%2C1253&ssl=1
categories: ["Python"]
type: post
lang: en
---

# How to Access Child-class Methods from Parent-class in Python

This topic tells accessing child class methods from the parent class. A concept is already available to access parent class methods from child class (using the super method). Here, it is the opposite.

Related[How to Fix Python Error ‘Can’t Instantiate Abstract Class’](https://srinimf.com/2022/08/08/how-to-fix-python-error-cant-instantiate-abstract-class/)

***As part of OOPS and avoiding code repetition, you can access parent class methods from the child. Similarly, vice versa. But how? Below example explains it.***

Related[Digital Skills That a Mainframe Developer Can Learn Easily](https://srinimf.com/2016/01/28/what-mainframe-programmers-should-learn-next/)

## **Accessing child class methods from the parent**

Before deep diving into details, the relationship usually goes from parent to child. Always parent is a master, and a child is born to a parent. The child can get its parent’s methods.

![Can parent class access child class method in python](https://i0.wp.com/srinimf.com/wp-content/uploads/2022/09/python.png?resize=371%2C281&ssl=1)*Child-to-parent accessing methods in Python*

Related[Python Theory Questions for Interviews](https://srinimf.com/2025/11/14/python-theory-questions-for-interviews/)

Below, you will find the logic is how one can **access child-class methods** from the parent class. It’s also an interview question.

Related[Function Vs. Method: What is the Difference in Python](https://srinimf.com/2024/10/10/function-vs-method-what-is-the-difference-in-python/)

## Child and Parent classes

Here, I have written two classes and explained how it works. And in the child class passed parent class as argument. I have now assigned the obj1 object to the parent class.

Related[10 Interview Questions Python Tree](https://srinimf.com/2022/06/11/10-interview-questions-python-tree/)

```
class parent:
    def __init__(self):
        pass
    def test1(self):
        print("I am in Parent")
        
class child(parent):
    def __init(self):
        pass
    def test2(self):
        print("I am in child class")
        

obj1=parent()
# Call to child-class method from parent
obj1.test2()
```

Related[How a MetaClass Works in Python and Real Usage](https://srinimf.com/2021/02/07/metaclasess-python2-vs-python3/)

Output

The below result shows an error when you try to call the child method from the parent. In interviews, you can tell you would get **an Attribute** error. So inheritance works from parent to child and not from child to parent.

```
Traceback (most recent call last):
  File "main.py", line 15, in <module>
    obj1.test2()
AttributeError: 'parent' object has no attribute 'test2'


** Process exited - Return Code: 1 **
Press Enter to exit terminal
```

Related

- [How to Fix Python Error ‘Can’t Instantiate Abstract Class’](https://srinimf.com/2022/08/08/how-to-fix-python-error-cant-instantiate-abstract-class/)DateAugust 8, 2022
- [10 Interview Questions Python Tree](https://srinimf.com/2022/06/11/10-interview-questions-python-tree/)DateJune 11, 2022
- [How to Use Python DATETIME Classes in Code](https://srinimf.com/2022/12/26/these-python-datetime-classes-developers-should-know/)DateDecember 26, 2022

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2022%2F09%2F06%2Fhow-to-access-child-class-methods-from-parent-class-in-python%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2022%2F09%2Fpexels-photo-8067800.jpeg%3Ffit%3D1200%252C800%26ssl%3D1&description=How%20to%20Access%20Child-class%20Methods%20from%20Parent-class%20in%20Python)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2022/09/06/how-to-access-child-class-methods-from-parent-class-in-python/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2022/09/06/how-to-access-child-class-methods-from-parent-class-in-python/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2022/09/06/how-to-access-child-class-methods-from-parent-class-in-python/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2022/09/06/how-to-access-child-class-methods-from-parent-class-in-python/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20How%20to%20Access%20Child-class%20Methods%20from%20Parent-class%20in%20Python&body=https%3A%2F%2Fsrinimf.com%2F2022%2F09%2F06%2Fhow-to-access-child-class-methods-from-parent-class-in-python%2F&share=email)
-

### Like this:

Like Loading…
