How does an `__init__` that takes only three parameters hand back an object holding five data attributes?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
A cycling app records a ride with three values the user supplies: a start time as a string, an end time as a string, and a distance in miles as a number. Following the design in the video, write the constructor of the class Ride so that it takes those three values in that order and stores each one, unchanged, on the object. The checks build Ride objects and read start, end and miles.
Implementing a type versus using it
Record that implementing a type means deciding its name and its attributes, both the data it holds and the methods it supports, while using it means creating instances and manipulating them.
Choosing which data a workout holds
List the properties every workout shares, icon, kind, start and end, heart rate, distance and calories, the extras a swim or a run adds, and the five this class keeps.
The constructor and the two attributes never passed in
Write class SimpleWorkout(object): with its constructor, marking self as the first parameter, the assignments self.start, self.end and self.calories, and the extra self.icon and self.kind = 'Workout'.