Created
May 15, 2017 20:32
-
-
Save BolajiOlajide/22c79dced510b5d69531b2ad0e89cfbc to your computer and use it in GitHub Desktop.
Array Data Checker
This file contains 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
sample_array = ['Bolaji','Damilola','Ichiato','Oladipupo','Koya','Mumeen'] | |
# I want to cycle through the array an check if an element is there. | |
# Here i want to see if 'Bolaji' is in the sample_array | |
def name_exists(name): | |
for element in sample_array: | |
if element == name: | |
print("Bolaji Exists") | |
else: | |
print("The Name Doesn't exist) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment