Notifications
Clear all

Python program to create a list of 10 integer elements. Ask user to enter the element to search.

   RSS

0
Topic starter

Output Example:
[10,25,20,35,55,24,48,66]

element = 24

element is present

1 Answer
0
Topic starter

i=10

lst=[]

while(i>0):

    n=int(input('enter the element: '))

    lst.append(n)

    i=i-1

print(lst)

n1=int(input('enter the element to search: '))

if(n1 in lst):

    print('number is present')

else:

    print('number is not present')

Share: