Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Student:
- student_instance_dict = {}
- def __init__(self, student):
- self.name = None
- self.phoneNumber = 0
- students = ['Mike', 'Dany']
- for student in students:
- instance = Student(student)
- Student.student_instance_dict[student] = instance
- print (Student.student_instance_dict[student].name)#this prints out without any problems
- def printUpdates(x):
- print (Student.student_instance_dict[student].x)
- name = 'name'
- printUpdates(name)
Add Comment
Please, Sign In to add comment