Lsearch.py 230 Bytes
Newer Older
Manasani suraj's avatar
Manasani suraj committed
1 2 3 4 5 6 7 8 9
list = [4, 2, 8, 9, 3, 7]
x = int(input("Enter number to search: ")
for i in range(len(list)):
 if(list[i] == x):
  found = True
  print("%d found at %dth position"%(x,i))
  break
if(found == False):
 print("%d is not in list"%x)