There are so many way to do this but the easiest way to check is using conditional statement.
Program:
mylist=[2,3,4,5,6,7,8,9]
x=int(input("Enter value to check:"))
if x in mylist:
mylist[mylist.index(x)] #do something to it
print("Found")
else:
print("Not found")
Comments