If you already copied over files from my week08 subdirectory, then copy over three new files in your week08 directory:
$ cd $ cd cs21/class $ cd week08 $ cp ~newhall/public/cs21/week08/listoflists.py . $ cp ~newhall/public/cs21/week08/gradebook.txt . $ cp ~newhall/public/cs21/week08/gradebook.py .Otherwise, create a week08 subdirectory in your cs21/class directory:
$ cd $ cd cs21/class $ mkdir week08 $ cd week08Then copy over my week08 files:
$ cp ~newhall/public/cs21/week08/* .
After class, you can copy over code I wrote in class doing the following:
$ cp ~newhall/public/cs21/week08/tia* .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *One restriction is that we will not allow the use of the string repetion operator in this solution:
# something like this is not allowed print " *" * 5Instead the only two print statements that we can use are:
print "*", # this prints a single star string followed by a space print " ",
Name1 grade1 grade2 grade3 ... gradeN Name2 grade1 grade2 grade3 ... gradeNWe are going to write a function to read in each line into a list of values, the first element will be the name string, the subsequent ones will be the grades stored as int values:
["name string", grade1, grade2, ... grade N]and for each list is creates it will add it to the list of lists to produce a data structure that looks like the following:
------- gradebook---> | *---|-------> ["name1 string", grade1, grade2, ..., grade N] |-----| | *---|-------> ["name2 string", grade1, grade2, ..., grade N] |-----| | *---|-------> ["name3 string", grade1, grade2, ..., grade N] |-----| . . . |-----| | *---|-------> ["nameM string", grade1, grade2, ..., grade N] -------Then we will write some functions for doing something with this list of lists.