title: Creating a Student class and printing from user input
body: <p>We were asked to do the following:</p>
  
  <p>Create a class Student with public member variables: Student name, student number, contact number, ID number. The following specifications are required:</p>
  
  <ul>
  <li>Add init() method of the class that initializes string member variables to empty strings and numeric values to 0.</li>
  <li>Add the method populate() to the class. The method is used to assign values to the member variables of the class. </li>
  <li>Add the method display() to the class. The method is used to display the member variables of the class. (2)</li>
  <li>Create an instance StudentObj of the class Student in a main program. </li>
  <li>The main program should prompt the user to enter values for five students. The attributes should be assigned to the instance of Student using its populate() method, and must be displayed using the display() method of the instance of Student. </li>
  </ul>
  
  <p>I have created an <strong>int</strong> function which initialises string variables to empty strings and numeric values to int variables, a populate function which assigns values to variables in the class and a display method to print the values of the class. The main method is supposed to ask the user to input their details and then print these details using the display() method.</p>
  
  <pre><code>class Student:
      def __init__(self, student_name, student_num,contact_num,ID_num):
          self.student_name = ""
          self.student_num = 0
          contact_num = 0
          ID_num = 0
  
      def populate(self,student_name, student_num,contact_num,ID_num):
          self.student_name = student_name
          self.student_num = student_num
          contact_num = contact_num
          ID_num = ID_num
  
      def display(student_name, student_num,contact_num,ID_num):
          print(student_name)
          print(student_num)
          print(contact_num)
          print(ID_num)
  
  def main():
      StudentObj = Student()
  
      s_name = int(input("Enter student name: "))
      s_num = int(input("Enter student number: "))
      con_num = int(input("Enter contact number: "))
      ID_num = int(input("Enter ID number: "))
  
      populate(s_name,s_num,con_num,ID_num)
      display(s_name,s_num,con_num,ID_num)
  if __name__ == '__main__':
      main()
  
  </code></pre>
  
  <p>The program finished with exit code 0, however it does not ask for any inputs or print anything</p>