Exercises

Here are some exercises for you to try on your own. Solutions are available at http://pragprog.com/titles/gwpy2/practical-programming.

  1. In this exercise, you will create a table to store the population and land area of the Canadian provinces and territories according to the 2001 census. Our data is taken from http://www12.statcan.ca/english/census01/home/index.cfm.

    Table 32. 2001 Canadian Census Data

    Province/Territory

    Population

    Land Area

    Newfoundland and Labrador

    512930

    370501.69

    Prince Edward Island

    135294

    5684.39

    Nova Scotia

    908007

    52917.43

    New Brunswick

    729498

    71355.67

    Quebec

    7237479

    1357743.08

    Ontario

    11410046

    907655.59

    Manitoba

    1119583

    551937.87

    Saskatchewan ...

Get Practical Programming, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.