python:for while

来源:互联网 发布:php.ini在哪 编辑:程序博客网 时间:2024/06/06 20:00
# -*-coding:utf-8-*-'''Created on 2017年4月29日@author: Administrator'''# if food = raw_input('you name is ')if food == 'jack':    age = 'kt'    print ageelif food == 'hack':    age = 'kts'    print age else:    print 'jack'# this is for """for i in range(10,0-1,-1):  print i  """  for i in range(0,11,2):# 开始数  结束数  每次递增的步长    print i#whilei=0while i<10:    print(i)    i=i+1#while is jiechengn=20fact =1i=2while i<n:    fact=fact*i    i=i+1print "number:"+str(fact)
0 0