I an new to object oriented python coding. And recently working on them.
Suppose that i have a code like:
class Student(object):
def __init__(self, name, age, job):
self.name = name
self.age = age
self.job = job
if i pass instance to it like:
a = Student('Ram', 12, False)
b = Student('Hira', 34, True)
Then i can uses class attributes on a and b like:
>>>a.name
Ram
>>>b.age
34
is it possible that i can access instances like:
>>>z=Student()
>>>z.name
Ram
Hira
>>>z.age
12
34
Any idea ??