Python Lesson 16 Exercises: Classes 1
In the following exercise, just create the classes. You do not have to create a program that uses the classes. These classes will be accessed from IDLE. Save the exercises as pa16-1 and pa16-2.
Exercise 1:
Copy the Clock class from the text. Modify it so that, along with the current time, it also prints the date (year, month, and day) at that timezone. You will need to research the time() module documentation to do this.
Exercise 2:
Create a teacher gradebook program that allows teachers to enter student names and grades. The program should display the student name, past scores, and current average. Use the Gradebook class in the notes as a starting point. The program must use classes.
Restricted access |