The following is the contents of the python file “student.py”:# Name: [your name]# email: [your Seneca Email address]class Student:def __init__(self, name,...




The following is the contents of the python file “





student.py





”:























# Name: [your name]




















# email: [your Seneca Email address]




















class Student:




















def __init__(self, name, number, program):




















programs = ['CNS', 'CTY']




















self.name = name




















self.number = number




















self.courses = {}




















if program in programs:




















self.program = program




















else:




















self.program = 'unknown'






























def displayStudent(self):




















result = 'Student: '




















result += self.name




















result += '\n'




















result += 'Student ID: '




















result += self.number




















return result



























(1) Update the Class definition of Student in “student.py”. Typing the following into the python interpreter should produce the following result:















>>>> import student








>>>> dave = student.Student('David', '01234', 'CTY')








>>>> dave + 'uli101'








>>>> print(dave.get_courses())








uli101: 0.0








>>>> dave + 'ops235'








>>>> print(dave.get_courses())








uli101: 0.0








ops235: 0.0


Apr 11, 2023
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here