20190810-while function usage

. 1  Import Random, Time
 2 List1 = 0
 . 3 List2 = 0
 . 4  for I in Range (l, 4 ):
 . 5      Print ( ' ------------- current are ' + STR (I) + ' Board ' + ' ------------- ' )
 . 6      the time.sleep (2 )
 . 7      List1 the random.randint = (0,100 )
 . 8      List2 the random.randint = (0,100 )
 . 9      A1 = Random .randint (0,50 )
 10      A2 = the random.randint (0,50)
 11      the while List1> 0 and list2> 0:
 12          # the while loop body is executed, and the test will be repeated until another test for the false statements after the execution of the loop. 
13 is          List1 = list1- A2
 14          List2 = list2- A1
 15          Print ( ' List1 remaining values: ' + STR (List1))
 16          Print ( ' List2 remaining values: ' + STR (List2))

 

Guess you like

Origin www.cnblogs.com/yssshiny/p/11332078.html