Write a python program to find the frequency of a number in a list.
Answer:
Code:
list1=[]
count=
0
n=int(input(
"Enter the number of elements in the list: "
))
for i in range(n):
list1.append(int(input(
"Enter element: "
)))
search=int(input(
"Enter the number to check frequency of: "
))
for i in range(n):
if(list1[i]==search):
count=count+
1
print("Frequency of ",search," is: ",count)