Create a python class called Grades.
Grades should include four pieces of information as data attributes
– a name(string), grade1(integer), grade2(integer),
grade3(integer). Grade1, grade2, and grade3 should have a
default value of 0. Your class should have an __init__ method
that initializes the four data attributes. Provide a read and write
property for each data attribute. Make each attribute private.
Grade1, grade2, grade3 should be a value that is 0-100 — use
validation in the properties for these data attributes to ensure
that they are valid.
Provide a calculate_average method that returns the average of
the grades.
Create a python class called Grades. Grades should include four pieces of information as data attributes – a name(strin
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am