Quick actions

cmd+k|ctrl+k

Navigation

Languages

While loop Reminder, 餘數 

Snippet info

Language

Python

Visibility

public

Author

chausage

Created

2024-12-02T08:54:39.787554Z

Updated

2024-12-02T08:57:32.816031Z

x=10
while x>= 0:
    x=x-1 #controller, otherwise 無限loop
    if x%2:# %:Remainder, 餘數
        continue
    if x==4:
        break #end loop
    print(x)
    
INFO