Advertisement
Txemin

Untitled

May 20th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. from random import randint
  2. sequence = [randint(0, 100) for i in range (20)]
  3. print(sequence)
  4.  
  5. number = int(input( "which number should I look for?"))
  6.  
  7. found = False
  8. for position, item in enumerate(sequence):
  9. if item == number:
  10. print("your number is in position {}".format(position ))
  11. found = True
  12. if found == False:
  13. print("Your number is not in the set")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement