While
# ask for 1-100 and A, sum = 1, 0 while a < 101: = a + 1, sum + a #
sum = sum + a
#
a = a + 1
print
#
5050,
While...else
# while Loop using the Else statement executes the ELSE statement when the conditional statement is False Count = 0 while count < 5: print (Count, " Span style= "COLOR: #800000" > less than 5 ", End=" ) # 0 is less than 5, 1 is less than 5, 2 is less than 5, 3 is less than 5, 4 is less than 5, count + = 1else : print (count, " greater than or equal to 5 ") # 5 is greater than or equal to 5
For in
for in range (1,3): print(i,end=","#,
For in ... else
# the For loop uses the Else statement to execute the ELSE statement when the conditional statement is False for in range (1,3): print(i,end=","#1, 2, Else: Print(i," greater than or equal to 3"# 3 is greater than or equal to 3
1. Range () traversal function
2. Break jumps out of the current loop
3, continue jump out of this cycle to continue the next cycle
4, pass empty statement, the general use of placeholder statements
12. Circulation