Lists

Lists

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.

This is lists0


2.  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”.  Your program should use a for loop and add them one by one.  Don’t use the “sum” function.

This is lists1


3.  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, this time using a for loop.  Again, don’t use the “sum” or “average” functions.

This is lists2

Choose one of…

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

OR

Make a card game.  Use the code I’ve written (cards) 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.

or

Something else – but check with me first.  A todo list manager?  something that processes text in a file?