2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-17 09:25:32 +00:00

'for else' fix

small logic and syntax fix
This commit is contained in:
Marek Madejski 2018-07-27 22:07:45 +02:00 committed by GitHub
parent d2e0916c04
commit b1abf6b7f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,7 @@ for i in x:
if i == 0:
break
else:
print('found')
print('not found')
'''
# Equivalent of:
@ -60,8 +60,8 @@ for i in x:
if i == 0:
flag = True
break
if flag
print('found')
if not flag:
print('not found')
'''
# Basic 'while' loop: