I want the user to put their GPA with a limited range from 1 - 5 (classes & inheritance)
I have an assignemt for school to ask the user to input their GPA from a limited range 1 - 5 only. this is an assingment for (classes & inheritence) chapter. please any help is appreciated thanks this is the code i could make below: # This file contains classes definition: class Person: def __init__(self, Name, Age, Gender, SSN): self.__Name = Name self.__Age = Age self.__Gender = Gender self.__SSN = SSN # =======SETTERS======== def set_name(self, Name): self.__Name = Name def set_Age(self, Age): self.__Age = Age def set_Genden(self, Gender): self.__Gender = Gender def set_ssn(self, SSN): self.__SSN = SSN # =============Getters========= def get_Name(self): return self.__Name def get_Age(self): return self.__Age def get_Genden(self): return self.__Gender def get_SSN(self): return self.__SSN # the class named Student that is a subclass of the Person class class Student(Person): def __init(self, Name, Age, Gender, SSN, StudentID, GPA): Person.__init__(self, Name, Age, Gender, SSN) self.__StudentID = StudentID self.__GPA = GPA # ================setters======== def set_StudentID(self,StudentID): self.__StudentID = StudentID def set_GPA(self, GPA): self.__GPA = GPA # ============Getters===== def get_StudentID(self): return self.__StudentID def get_GPA(self): return self.__GPA # ===============str=============== def __str__(self): return 'Name: ' + Person.get_Name(self) + '\n Age: ' + str(Person.get_Age(self)) + \ '\n Gender: ' + str(Person.get_Genden(self)) + \ '\n SSN: ' + str(Person.get_SSN(self)) + '\n StudentID: ' + str(self.__StudentID) + \ '\n GPA: ' + str(self.__GPA)