This repository has been archived on 2021-10-31. You can view files and clone it, but cannot push or open issues or pull requests.
DSA/1st.py

17 lines
288 B
Python
Raw Normal View History

2019-02-21 11:17:07 +00:00
#!/usr/bin/env python3
# vim: set ts=4 sw=4 et tw=80:
import sys
def find(A, x):
i = 0
while i < len(A):
if A[i] == x:
return i
i = i + 1
return None
if __name__ == "__main__":
A = [int(x) for x in sys.argv[1:]]
print(find(A[1:], A[0]))