1,760
edits
Changes
→Create a Python Script Demonstrating Classes
=== Create a Python Script Demonstrating Classes ===
:# The following python script is broken. It has two major problems to fix and one new feature to add: <br />'''first problem ''' is providing the student number as an integer causes an error(TypeError) when displayStudent() is run, <br />'''second problem ''' is in displayGPA() may divide by zero(ZeroDivisionError) if no courses are added to the dictionary or the grades added to the dictionary are 0.0 floats. <br />'''Finally''', you will add a new method to this class that prints out a formatted list of all courses the student has taken.
:#Create the '''~/ops435/lab6/lab6a.py''' script.
:#Use the following as a template(warning this is NOT the same as student.py):<source lang="python">