January 2015
Intermediate to advanced
360 pages
8h 50m
English
There are three ways we can build namedtuple instances. The choice of technique we use is generally based on how much additional information is available at the time of object construction.
We've shown two of the three techniques in the examples in the previous section. We'll emphasize the design considerations here. It includes the following choices:
haversine() function to the start and end points to create a Leg object.
Leg(start, end, round(haversine(start, end),4))
*argument notation to assign parameters ...Read now
Unlock full access