Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
linearSearch.py
#python 3.5.2 #Linear Search from array import * arr=array('i',[]) size=int(input("enter size")) for i in range(size): arr.append(int(input("enter next value"))) print("Original array") for i in range(len(arr)): print(arr[i]) search=int(input("enter element to search")) k=0 found=0 for e in arr: if e==search: found=1 break k+=1 if found==1: print(search," found @ ",k) else: print(search," Not found")
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
function and doc string
Fu 1
List problem - add items
count(even/odd)fromlist.py
string length
word repeat
Яндекс.Интервью - Задача C
self "keyword"
Organizing Transactions
hw5 ss while
stackse - search stackoverflow differently
Please log in to post a comment.