Write a class student that stores the information of a student and make sure that the admission no. of the student entered is not repeated.


In [6]:
class student(object):
    admno = []
    def __init__(self):
        self.name = raw_input('Enter name: ')
        while True:
            self.adm = raw_input('Enter admission no: ')
            if self.adm not in student.admno:
                student.admno.append(self.adm)
                break
            else:
                print 'Admission number already exists. Please try again.'
        self.rollno = int(raw_input('Enter roll number: '))
        self.c = int(raw_input('Enter class: '))
        self.sec = raw_input('Enter section: ')
        self.grades = raw_input('Enter grades separated by space: ').split()

In [ ]: