Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sequence=[2,1,3,4,5,3,5,6]
- n = int(input("Which number are you looking for? "))
- position = 0
- def search(sequence,n):
- for position in range(len(sequence)):
- if n == sequence[position]:
- print(sequence[position], "is at position", str(position))
- position +=1
- return n
- search(sequence,n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement