Skip to content

Instantly share code, notes, and snippets.

@FerdinaKusumah
Created July 28, 2020 13:36
Show Gist options
  • Save FerdinaKusumah/d0d9ac148a3f392c0fae08a93b234a52 to your computer and use it in GitHub Desktop.
Save FerdinaKusumah/d0d9ac148a3f392c0fae08a93b234a52 to your computer and use it in GitHub Desktop.
[Python] For Else
"""For else"""
arr = [1, 2, 3, 4]
find_num = 10
for num in arr:
if find_num == num:
break
else:
print(f'{find_num} is not exists in array')
# 10 is not exists in array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment