09 - Sequences and Lists

Watch the following video, and do the examples shown in the video as they are demonstrated.

Assignment

Assign a leader to create and share a Google Doc, then create a series of "Notes from this video" similar to the notes that appeared with the previous tutorials. Once they are finished, get them approved by the instructor.

Assignment

Using the "family" example given in the video, write a program that prints each element of the list, as shown:

Item #1 is mom

Item #2 is dad

Item #3 is bro

Item #4 is sis

Item #5 is dog

Save as 09_Lists.py.

Assignment

Write a program that stores the first 5 prime numbers in a list named prime and prints the second last number, similar to the following:

The second last prime number in our list is #

Save as 09_Lists_2.py.

Assignment

Write a program that extracts the 3rd character from a string s containing the value "abcdefghijklmnopqrstuvwxyz".

Save as 09_Lists_3.py.

Further Reading

For a comprehensive reference on Python lists, visit:

http://en.wikibooks.org/wiki/Python_Programming/Lists

10 - Slicing