Skip to content

Commit

Permalink
No need to create a variable for length (keon#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnavb authored and danghai committed Sep 3, 2018
1 parent e6df887 commit 02b6e36
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions algorithms/search/linear_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
#

def linear_search(array, query):
length = len(array)
for i in range(length):
for i in range(len(array)):
if array[i] == query:
return i

Expand Down

0 comments on commit 02b6e36

Please sign in to comment.