Created
June 22, 2018 14:08
-
-
Save lol97/7749953c5a01bcf55cb16e63f5ffa96e to your computer and use it in GitHub Desktop.
Lakad Matatag
This file contains hidden or 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 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