案例1:
for i in range(1,6): print(i) print(‘The for loop is over‘) #输出: #1 #The for loop is over #2 #The for loop is over
案例2:
for i in range(1,3): print(i) else: print(‘The for loop is over‘) #输出:
#1 #2 #The for loop is over
2023-10-19 22:11:52
案例1:
for i in range(1,6): print(i) print(‘The for loop is over‘) #输出: #1 #The for loop is over #2 #The for loop is over
案例2:
for i in range(1,3): print(i) else: print(‘The for loop is over‘) #输出:
#1 #2 #The for loop is over
下一篇:C++学习1——入门学习