Skip to content

Instantly share code, notes, and snippets.

@lol97
Created June 22, 2018 14:08
Show Gist options
  • Select an option

  • Save lol97/7749953c5a01bcf55cb16e63f5ffa96e to your computer and use it in GitHub Desktop.

Select an option

Save lol97/7749953c5a01bcf55cb16e63f5ffa96e to your computer and use it in GitHub Desktop.
Lakad Matatag
def linearSeach(data,key):
for i in range(len(data)):
if data[i] == key:
return i
return -1
def makeList(lenData):
data = []
for x in range(lenData):
lol = int(input())
data.append(lol)
return(data)
def doIt():
lenData,key = input().split()
lenData = int(lenData)
key = int(key)
data = []
if(lenData<0):
return("Can't do that")
else:
data = makeList(lenData)
return(linearSeach(data,key))
print(doIt())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment