though i'm calling pr() function in the subclass after calling the get_details() function(which assigns value to name) it doesn't print the current value of name.
My question is if i want to print the value of name in the subclass what should i do???? I've tried in many ways using __init__ and blah..blah.. so please help me out....
class employee:
name=' '
def get_details(self):
name=input('Enter the employee name')
print("In super class-->",name)
class calc(employee):
def pr(self):
print("In sub class==>",employee.name)
if __name__=='__main__':
x=employee()
x.get_details()
y=calc()
y.pr()
RESULT:
Enter the employee namegjh
In super class--> gjh
In sub class==>