Wednesday, June 5, 2013
Python Basics II
We continued with our intro to the basics of the Python language. This week we played a little with lists and then also started with the various iteration methods. We used a while loop to create a list of random numbers and also to control a block of code that looked for a specific number and removed all instances of it from the list. I also learned that you can't delete items from a list while you're iterating over the list itself (as in for eachitem in myList). That makes sense, but it also feels like a natural approach (one that I found a large number of people asking about on OverStack).
Labels:
GIS5103
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment