Lists and Sequences

Before you start, make a folder called “Lists” in your IDE.  Put all the work for this chapter in that folder.


1.  Make a list of grades.

grades_list = [89, 78, 99, 85]

write a program that prints out the grades, each on its own line.  Use a for loop.

Save this program as

write a program using a for loop that adds up all the elements in the list.  One way to do it is with a variable “total”.

Save this program as

2.  Make a program that asks you for grades and stores them in a list until the user enters a negative number.  (Use a while loop for this, and grades_list.append to get the values into the list. Remember you can make an empty list with

grades_list = [ ]

When you’re done entering grades, have the program find and print out  the average grade.

Save this program as

Choose one of…

Write a program ( of you own that is a useful grades calculator.  Use a while loop and some kind of menu.  See what you can do.

Make a new program ( that reads the information from a text file.  Use a paper or something you’ve written for another class and print out the words alphabetically.   Make sure you’re reading a text file and not a document.

You might have to copy and paste into a text editor   You may have to look some stuff up to make this work.

And / Or…

Make a card game.  Use the code I’ve written to write some kind of card game.  Make sure you understand the code I’ve written first.   You could make BlackJack, or War, or anything you want.  You might not finish, but do what you can.


A good website showing some of what you can do with lists.