CS 140
Practice problems on Lists
Here are some practice programming problems using lists and tuples.
These are not to be handed in, though you should feel free to ask questions about any of them outside of class. Remember that programming is an activity that you learn by doing.
5. Change program (4) so that the output is in order from smallest number to
largest number. For the example given it will be
thingamabob:
3
gizmos: 15
widget: 24
6. Write a program that inputs a list of values (doesn't matter if they are
numbers or strings) and then prints all of the values
that appear in the list more than once.
7. Write a program that inputs a list of numbers and outputs basic statistical
information about the list: minimum and maximum
values, average value, standard deviation (the square
root of variance; we gave a formula for this in class -- ask me if you
can't find it), and median (middle value). Each of these
is pretty easy to calculate; just write a function to find each of them.