Pytion 005 if for while
# -*- coding: cp936 -*-
#D:\workspace\Pytion_workspace\004_list.py
#=================001_分支结构====================
nAge =15
if nAge==1:
print 'children'
elif nAge==2:
print 'haha children'
else:
print 'bye bye,you\'are wrong !'
#=================002_循环结构_while===============
while nAge <30:
print '%s' %(nAge)
nAge = nAge+1
#=================003_循环结构_for===============
print 'for x in a, the a is list'
a =[2,3,4,5]
for x in a :
print x
posted on 2016-07-03 00:03 fantiejun0436 阅读(89) 评论(0) 收藏 举报
浙公网安备 33010602011771号