Python08 the branch and loop 3 (for, while loop)

A, for the statement:

for goals in the expression:

  Loop

. 1 I = " Lakers championship " 
2  for each in I:
 . 3      Print (each)    
 . 4  Lake
 5  persons
 6  Total
 7  crown
 8  Jun
 . 9   for each in I:
 10      Print (each, len (each), End = "  " )
 11  
12 Lake 1 is always on Jun 1 1 1 1 crown
View Code

Two, while statement

while conditions:

  Loop

 (When the condition is true, execution cycle thereof)

. 1  for I in Range (0,5,1 ):
 2      the while I <. 4 :
 . 3          Print ( " ! Lakers championship " , I)
 . 4          I = +. 1
 . 5          
. 6  Lakers championship! 0
 7 Lakers championship! 1
 8 Lakers championship! 2
 9 Lakers championship! 3
 10 Lakers championship! 1
 11 Lakers championship! 2
 12 Lakers championship! 3
 13 Lakers championship! 2
 14 Lakers championship! 3
 15 Lakers championship! 3
View Code

 

Guess you like

Origin www.cnblogs.com/ksht-wdyx/p/11308643.html