Quick actions

cmd+k|ctrl+k

Navigation

Languages

Else after while

Snippet info

Language

Python

Visibility

public

Author

hilmi-am

Created

2020-06-23T13:47:47Z

Updated

2020-06-23T13:47:47Z

x = 10
while x > 0:
    x = x - 1
    if x == 2:
        break
    print(x)
else:
    print('Loop is finished')
    
INFO