+3 votes
in Class 12 by kratos

Accept a list containing integers randomly. Accept any number and display the position at which the number is found in the list.

1 Answer

+2 votes
by kratos
 
Best answer

maxrange = input(“Enter Count of numbers: ’’)

marks=[]

flag=False

for i in range(0, maxrange):

marks. append(input(“ ?”))

number = inputfEnter number to be searched”)

for i in range(0, maxrange):

if marks [i]==number:

print number,“found at position”,i

flag=True

if flag==False:

print number, “not found in list”

...