Skip to content

Instantly share code, notes, and snippets.

@FerdinaKusumah
Last active December 5, 2019 01:51
Show Gist options
  • Save FerdinaKusumah/e2a02b57538e3b382d9eacc012ecdfa6 to your computer and use it in GitHub Desktop.
Save FerdinaKusumah/e2a02b57538e3b382d9eacc012ecdfa6 to your computer and use it in GitHub Desktop.
For else
"""For else"""
a = [1, 2, 3, 4]
# Search number in list
search_num = 10
for num in a:
if num > search_num:
break
else:
print("Sorry but number you're trying to find is not found")
# Sorry but number you're trying to find is not found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment