write a program search for a given element in a list of numbers. we have to take input.
Program the following
Hi @shubhamkswn00
Please refer following code:
lst=eval(input(“Enter list:”))
length=len(lst)
element=int(input(“Enter element to be searched for:”))
for i in range(0,length):if element==lst[i]: print(element,”found at index”,i) break else: print(element,”not found in given list”)
Hope this might helps
sir not working it is showing error please help me please be with me on meet as soon as possible
sir which chat and where it is visible
Hi @shubhamkswn00
Its working for me, for your reference I have shared a colab file with you. Please have a look once
Hope that it might helps
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.