Guest User

Untitled

a guest
Dec 13th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. class Student:
  2.  
  3. student_instance_dict = {}
  4.  
  5. def __init__(self, student):
  6.  
  7.  
  8. self.name = None
  9. self.phoneNumber = 0
  10.  
  11.  
  12. students = ['Mike', 'Dany']
  13. for student in students:
  14. instance = Student(student)
  15. Student.student_instance_dict[student] = instance
  16.  
  17.  
  18. print (Student.student_instance_dict[student].name)#this prints out without any problems
  19.  
  20. def printUpdates(x):
  21. print (Student.student_instance_dict[student].x)
  22.  
  23. name = 'name'
  24. printUpdates(name)
Add Comment
Please, Sign In to add comment