Write a program to check a given number is present in list. If present, display the position of the element in a list. If the element is not present, add the element to the list.
l=[1,2,4,3,6]
x=int(input("enter a number:"))
for i in l:
if(i == x):
print("number present at")
print(l.index(x))
else:
l.append(x)