Guest User

Untitled

a guest
Apr 21st, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. Biggus Dickus 77
  2. Biggus Dickus 77
  3. Biggus Dickus 77
  4.  
  5. class Student(object):
  6. fname = ""
  7. lname= ""
  8. idNo = 0
  9.  
  10. def __init__(self, firstname, lastname, idnumber):
  11. self.fname = firstname
  12. self.lname = lastname
  13. self.idNo = idnumber
  14.  
  15.  
  16. def make_student(fname, lname, idNo):
  17. student = Student(fname, lname, idNo)
  18. return student
  19.  
  20.  
  21. def main():
  22. maxStudCount = 0
  23. studentList = []
  24. studQuery = raw_input("Would you like to add a student? (Type 'Yes' or 'No'): ")
  25.  
  26. while studQuery == 'Yes' and maxStudCount < 10:
  27. fname = raw_input("Enter first name: ")
  28. lname = raw_input("Enter last name: ")
  29. idNo = raw_input("Enter ID No: ")
  30.  
  31. person = make_student(fname, lname, idNo)
  32. studentList.append(person)
  33.  
  34. maxStudCount = maxStudCount + 1
  35. studQuery = raw_input("Add another student? ('Yes' or 'No'): ")
  36.  
  37.  
  38. for item in studentList:
  39. print fname, lname, idNo
  40.  
  41.  
  42. if __name__ =='__main__':
  43. main()
Add Comment
Please, Sign In to add comment