Quick actions

cmd+k|ctrl+k

Navigation

Languages

20250815-03

Snippet info

Language

Python

Visibility

public

Author

becky99

Created

2025-08-15T11:17:30.583885Z

Updated

2025-08-15T11:43:11.894151Z

# for-repeating time is determined
# while()-repeating time is unknow
# case 1: controller inside while loop 
x=1
while(True):
    print(x)
    x=x+1
    # add a controller
    if (x==3):
       print(x) 
       continue
       x=x-1
    if(x==7):
       break
else:
    print("loop exit normally")
#case 2: controller at while condional)
while (x<10):
    print("second while loop:",x)
    x=x+1
else:
    print("second loop exit normally")
    
INFO