Created
July 28, 2020 13:36
-
-
Save FerdinaKusumah/d0d9ac148a3f392c0fae08a93b234a52 to your computer and use it in GitHub Desktop.
[Python] For Else
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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