Python 어렵게 배우기 - Exercise 32: Loops and Lists
원문 : http://learnpythonthehardway.org/book/ex32.html List에 대해서 알아보자 (ex32.py) the_count = [1, 2, 3, 4, 5] fruits = ['apples', 'oranges', 'pears', 'apricots'] change = [1, 'pennies', 2, 'dimes', 3, 'quarters'] # this first kind of for-loop goes through a list for number in the_count: print "This is count %d" % number # same as above for fruit in fruits: print "A fruit of type: %s" % fruit # also ..
더보기