标签:style blog http color for strong sp div 2014
for i in range(1,5): print i
for i in range(5): print i
#!/usr/bin/python list=[‘lk‘,‘tom‘,‘jack‘] a=4 for name in range(1,a): print name
[root@likun python_scripts]# cat 4for.py #!/usr/bin/python list=[‘lk‘,‘tom‘,‘jack‘] for name in list: if name==‘lk‘: print name,‘ is very good!‘ else: print name print ‘loop over!‘ [root@likun python_scripts]# python 4for.py lk is very good! tom jack loop over!
[root@likun python_scripts]# cat 5while.py #!/usr/bin/python whileTrue: input=raw_input(‘(alive|dead|other):‘) if input==‘alive‘: print ‘The process is ‘,input else: print ‘The process is ‘,input break
标签:style blog http color for strong sp div 2014
原文地址:http://www.cnblogs.com/kissdb/p/4009560.html