How To Find Item In A List of Python Program ?.

Program to searching item in a list in python.



Code:

num=[98,76,67,54,34,90,55,34,65,33,12,88,70,76,54]
loc=-1
print("total item:",num)
item=int(input("Enter your searching item:"))
for i in range(0,len(num)):
   if item==num[i]:
       loc=i
       print("Item in list and location number is:",loc)
    
    
if loc==-1:
    print("Item not found")


*

إرسال تعليق (0)
أحدث أقدم