「Python入門」for、while繰返し処理の使い方

#繰返し処理1
names = ['Michael’, 'Bob’, 'Tracy’]
for name in names:
print name

# 繰返し処理2
for x in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]:
print x

#繰返し処理3
for x in range(101):
print x

# while
n = 88
while n > 0:
print n
n = n – 2

Python

Posted by arkgame