python programming

self.username < other.username
__init__ __str__ __repr__ __lt__ email study_group add_group_member__init__, __str__, and __repr__ are tested again in the OnlineStudent class because they are overridden methods.
students.txt
mcarter,Carter,Marilyn,312/473-4837,1,mcarter@coolmail.net ggraber,Graber,Gary,312/837-2837,3,ggraber@coolmail.net ccarpent,Carpenter,Carrie,312/377-2873,2,ccarpent@coolmail.net ccheng,Cheng,Sam,312/272-4473,1,scheng@coolmail.net obooker,Booker,Olivia,312/928-3980,4,obooker@coolmail.net rscanchez,Sanchez,Ricardo,312/838-9928,2,rsanchez@coolmail.net cdharan,Dharan,Connor,312/263-3922,2,cdharan@coolmail.net yboulet,Boulet,Yvette,312/235-3728,3,yboulet@coolmail.net rbolger,Bolger,Raymond,312/663-3827,4,rbolger@coolmail.net sstrickl,Strickland,Sheryl,312/878-9800,1,sstrickl@coolmail.net
study-groups.txt
ccarpent,yboulet,obooker yboulet,ccarpent,obooker obooker,ccarpent,yboulet ccheng,cdharan,rbolger,ggraber cdharan,rbolger,ggraber,ccheng rbolger,ggraber,ccheng,cdharan ggraber,ccheng,cdharan,rbolger mcarter,sstrickl sstrickl,mcarter
CODE:(TESTING STUDENT CLASS)
class Student:
def __init__(self,i,last,first,ph,yr):
self.username = i
self.last_name = last
self.first_name = first
self.phone = ph
self.year = yr
def __str__(self):
return "Username: "+self.username+"\nName: "+self.first_name+" "+self.last_name+"\nPhone: "+self.phone+"\nYear: "+str(self.year)
def __repr__(self):
return f'Student("{self.username}", "{self.last_name}","{self.first_name}","{self.phone}",{self.year})'
def update_year(self):
self.year = int(input("Enter new value for year"))
def main():
l = []
fh = open('students.txt','r')
for line in fh.readlines():
i,last,first,ph,yr,mail = line.split(',')
l.append(Student(i,last,first,ph,int(yr)))
fh.close()
for i in l:
print(i)
main()
OUTPUT:

CODE:(TESTING ONLINESTUDENT CLASS)
class Student:
def __init__(self,i,last,first,ph,yr):
self.username = i
self.last_name = last
self.first_name = first
self.phone = ph
self.year = yr
def __str__(self):
return "Username: "+self.username+"\nName: "+self.first_name+"
"+self.last_name+"\nPhone: "+self.phone+"\nYear:
"+str(self.year)
def __repr__(self):
return f'Student("{self.username}",
"{self.last_name}","{self.first_name}","{self.phone}",{self.year})'
def update_year(self):
self.year = int(input("Enter new value for year"))
class OnlineStudent(Student):
def __init__(self,i,last,first,ph,yr,em):
super().__init__(i,last,first,ph,yr)
self.email = em
self.study_group = []
def __str__(self):
return super().__str__()+"\nEmail: "+self.email+"\nStudy group:
"+self.study_group
def __lt__(self,other):
if self.username<other.username:
return True
else:
return False
def add_group_member(self,member_id):
self.study_group.append(member_id)
python programming Goal: Implement and test the OnlineStudent class as shown in the Student/OnlineStudent UML Diagram....
in python please I need both unittest and traditional test
Goal: Implement and test the OnlineStudent
class as shown in the Student/OnlineStudent UML Diagram.
Input Files:
students.txt study-groups.txt
The study_group instance variable is a list that contains the
username values of the other members in the student's study
group.
Details:
Implement the OnlineStudent class in the module
onlinestudent.py as specified by the Student/OnlineStudent UML
Diagram. OnlineStudent is the derived class of the base
classStudent.
The __lt__ method for an OnlineStudent...
this is written in python
Goal: Implement and test the Onlinestudent class as shown in the Student/OnlineStudent UML Diagram Relevant Examples: EmployeeHierarchy PersonArray Pet Input Files: students.txt study-groups.txt The study_group instance variable is a list that contains the username values of the other members in the student's study group Details: 1. Implement the onlinestudent class in the module onlinestudent.py as specified by the Student/OnlineStudent UML Diagram. Onlinestudent is the derived class of the base class student. 2. The_1t__method for an...
A) Please implement a Python script to define a student class with the following attributes (instance attributes): cwid: student’s CWID first_name : student’s first name last_name: student’s last name gender: student’s gender gpa: student’s gpa Please make these attributes as private ones so they have to be accessed via getter/setter methods or property. For this purpose, please define a getter/setter method and property for each of the attributes. Another thing you need to do is to define a constructor that...
PYTHON 3 Object Oriented Programming
***a9q3.py file below***
class GradeItem(object):
# A Grade Item is anything a course uses in a grading scheme,
# like a test or an assignment. It has a score, which is assessed by
# an instructor, and a maximum value, set by the instructor, and a weight,
# which defines how much the item counts towards a final grade.
def __init__(self, weight, scored=None, out_of=None):
"""
Purpose:
Initialize the GradeItem object.
Preconditions:
:param weight: the weight...