call a function of a class from another class using inheritance in python code example

Example 1: inheritance in python

# creating parent class
class Parent:
    BloodGroup = 'A'
    Gender = 'Male'
    Hobby = 'Chess'
    
# creating child class
class Child(Parent): # inheriting parent class
    BloodGroup = 'A+'
    Gender = 'Female
    
    def print_data():
        print(BloodGroup, Gender, Hobby)
    
# creating object for child class
child1 = Child()
# as child1 inherits it's parent's hobby printed data would be it's parent's
child1.print_data()

Example 2: call a function from another class python

class A:
    def method1(arg1, arg2):
        # do code here

class B:
    A.method1(1,2)