代码如下:
1.py
#!/usr/bin/python
for i in range(0,10,2):
print i
2.py
#!/usr/bin/python
for i in range(0,10):
if i%2 == 0:
print i
3.py
#!/usr/bin/python
i=0
run=True
while run:
if i<10:
print i
i=i+2
else:
run=False
4.py
#!/usr/bin/python
for i in [0,2,4,6,8]:
print i
5.py
#!/usr/bin/python
i=0
run=True
while run:
if i<10:
if i%2==0:
print i
i=i+1
else:
i=i+1
else:
run=False