Created
December 21, 2016 20:48
-
-
Save vividhsv/4fbf7df5189f113eee047231a22c16f1 to your computer and use it in GitHub Desktop.
Linear Search
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
def linear_search(item, list): | |
for i in list: | |
if i == item: | |
return True | |
return False | |
print(linear_search(4, [1, 2, 4, 4, 5])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment