Difference between revisions of "CSC111 Lab 11 2015"
(Created page with "--~~~~ ---- <onlydft> =List of Lists= ==Animals== <br /> ::<source lang="text"> Cheetah 70.0 mph Pronghorn Antelope 61.0 mph Wildebeest 50.0 mph Lion 50.0 mph Thomson's...") |
|||
Line 3: | Line 3: | ||
<onlydft> | <onlydft> | ||
+ | <bluebox> | ||
+ | Very often we are presented with text information in the form of lists. They can be list of email addresses, list of contacts, list of courses, list of students, list of historical facts, list of authors, etc. And very often we need to extract just a few items from the list that are of interest to us. In this lab, you are going to process several lists and extract information from them. | ||
+ | </bluebox> | ||
+ | =List of Lists= | ||
+ | ==Demonstration Example== | ||
+ | <br /> | ||
+ | Create a new new program called Lab11_0.py and copy the code from this [[CSC111 List of Tuples Demo| program]]. | ||
+ | |||
+ | <br /> | ||
− | |||
==Animals== | ==Animals== | ||
<br /> | <br /> | ||
+ | The text below contains names of animals and their speed, expressed in miles per hour. Write a Python program (no need to write classes for this problem) that will create a list | ||
+ | <br /> | ||
+ | |||
::<source lang="text"> | ::<source lang="text"> | ||
+ | Black Mamba Snake 20.0 mph | ||
+ | Cape Hunting Dog 45.0 mph | ||
+ | Cat (domestic) 30.0 mph | ||
Cheetah 70.0 mph | Cheetah 70.0 mph | ||
− | + | Chicken 9.0 mph | |
− | + | Coyote 43.0 mph | |
− | + | Elephant 25.0 mph | |
− | |||
− | |||
Elk 45.0 mph | Elk 45.0 mph | ||
− | + | Giant Tortoise 0.2 mph | |
− | + | Giraffe 32.0 mph | |
Gray Fox 42.0 mph | Gray Fox 42.0 mph | ||
+ | Greyhound 39.4 mph | ||
+ | Grizzly Bear 30.0 mph | ||
+ | Human 27.9 mph | ||
Hyena 40.0 mph | Hyena 40.0 mph | ||
− | + | Jackal 35.0 mph | |
+ | Lion 50.0 mph | ||
Mongolian Wild Ass 40.0 mph | Mongolian Wild Ass 40.0 mph | ||
− | + | Mule Deer 35.0 mph | |
− | + | Pig (domestic) 11.0 mph | |
+ | Pronghorn Antelope 61.0 mph | ||
+ | Quarter Horse 47.5 mph | ||
Rabbit (domestic) 35.0 mph | Rabbit (domestic) 35.0 mph | ||
− | |||
− | |||
Reindeer 32.0 mph | Reindeer 32.0 mph | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Six-Lined Racerunner 18.0 mph | Six-Lined Racerunner 18.0 mph | ||
− | + | Spider (Tegenaria atrica) 1.2 mph | |
Squirrel 12.0 mph | Squirrel 12.0 mph | ||
− | + | Thomson's Gazelle 50.0 mph | |
− | |||
− | |||
− | |||
Three-Toed Sloth 0.1 mph | Three-Toed Sloth 0.1 mph | ||
+ | Warthog 30.0 mph | ||
+ | Whippet 35.5 mph | ||
+ | White-Tailed Deer 30.0 mph | ||
+ | Wild Turkey 15.0 mph | ||
+ | Wildebeest 50.0 mph | ||
+ | Zebra 40.0 mph | ||
</source> | </source> | ||
<br /> | <br /> |