Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/geekcomputers/Python
/ linearsearch
Function
linearsearch
linear search.py:4–8 ·
view source on GitHub ↗
(arr, x)
Source
from the content-addressed store, hash-verified
2
3
4
def
linearsearch(arr, x):
5
for
i in range(len(arr)):
6
if
arr[i] == x:
7
return
i
8
return
-1
9
10
11
arr = [
"t"
,
"u"
,
"t"
,
"o"
,
"r"
,
"i"
,
"a"
,
"l"
]
Callers
1
linear search.py
File · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected