Think Python, Chapter 10, Lists: 10-1 & 10-2
- April 8th, 2012
- Posted in Computer Science . Lists
- By arlis.hoglen
- Write comment
Read 10-1 thru 10-2 in Think Python.
After reading, add a comment (question or question) on this post regarding a question you have after the reading and doing examples or a comment which summarizes your understanding. Your comment must
- Show depth of understanding
- Can be an extension of the reading as in something you know about the subject but was not covered
- Will be proof you have read the two sections
- Merely quoting the text is not acceptable
Comments will account for 10% of your grade for this part of the unit.
We will do the examples in class tomorrow.

There are Strings and Integers. Now, we are learning about a new sequence; “lists” which I guess is involving things related to slicing.
I understand that lists are mutable, it’s like what we learned in the last chapter mixed with slicing.
Both sections show an interesting use of lists, which haven’t been really used since Hangman so this chapter seems like a good thing to learn for programming in python
What do you suspect that he called the list containing ['crunchy frog', 'ram bladder', and 'lark vomit']? Also, it’s pretty cool that you can mutate just one of the variables inside the list without changing the rest of the list.
The section was fairly simple to me as i’ve gone into mutable lists and know the whole. list[1] = ‘pansy’
print list[1]
pansy
I wasn’t as quite adept on the part where you could have a list within a list but that makes sense to me now, as you could have a variable standing for a number within a list, and thats practically the same as having a list within a list, except the list stands for a lot more variables, strings, and lists generally.
The ‘in’ operator function in a list also makes sense to me, as I’ve used it in project work, but I also understood that you could check…
#for i in :
so it only makes sense you could check for an item with ‘in’ a list.
I’ve been through most of the list stuff before, and it’s really useful for making sprites work in a game. I don’t quite have the hold on the lists within lists part, but the only thing I really learned in the section was that there was a type of cheese called Edam. I guess that’s just shows how much I pay attention to cheese.
Just like a string is a series or “sequence” of characters a list is a Sequence of Values. The big difference is that a list is mutable meaning changeable. Strings have to be entirely rewritten. You can’t just change a letter without making a new string.
Whereas a list can be change at any one of its items (and even that item may be mutable!)
Mutable(i.e. List) items within Mutable items can go forever without having to reset an entire anything. You can just change directly what you want inside what you want if the item is mutable.
As i looked at the codes on both chapters, it seems like it wont be as hard to write. The only problem i see is understanding the meaning of the vocab.
Rafa,
Vocab takes effort. Try a word a day and use it in discussion with your friends (I think they will be impressed). The difficult part will be figuring out where they fit in ordinary conversations.
Alternately, use flash cards.
As you work through the problems, pay attention to the terms. I highlight the terms in my PowerPoint during class discussion and practice.
How does mapping work? Explanation?
Good question!
Mapping refers to the relationship between a list’s elements and their indices. We can track mapping (changes to elements and their indices) with state diagrams. State diagrams are similar to stack diagrams but instead of tracking all variables it tracks the state of elements (as in a list). Check chapters 3-10 and 10-2. Compare the stack diagram to the state map.