i=0 while i<5: print("当前是第%d次执行循环"%(i 1)) print("i=%d"%i) i =1
#encoding=utf-8 i=1 sum = 0 while i<=100: sum = sum i i = 1 print("1~100的累积和为:%d"%sum)
#encoding=utf-8 i=1 sum = 0 while i<=100: if i%2 == 0: sum = sum i i =1 print("1~100的累积和为:%d"%sum)
* ** *** **** *****
i=1 while i<=5: j=1 while j<=i: print("* ",end='') j =1 print("\n") i =1
i=1 while i<=9: j=1 while j<=i: print("%d*%d=%-2d "%(j,i,i*j),end='') j =1 print('\n') i =1