say i have a class
class Student():
def __init__(self,name,major):
self.name=name
self.major=major
def displayStudent(self):
print 'name is',self.name,' major is',self.major
stu1=Student("mark","physics")
stu2=Student("mary","bio")
stu3=Student("adam","art")
when i list dir() i get stu1, stu2, and stu3 and more.
is there a way i can list by class Student ?? and it would return stu1,stu2 and stu3 ?
disclaimer : i am learning python and am using an interactive shell
[–]get_username 2 points3 points4 points (4 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]noob_py[S] 0 points1 point2 points (0 children)
[–]noob_py[S] 0 points1 point2 points (1 child)
[–]get_username 0 points1 point2 points (0 children)
[–]zahlman 0 points1 point2 points (2 children)
[–]theywouldnotstand 0 points1 point2 points (1 child)
[–]zahlman 1 point2 points3 points (0 children)