Programming Examples
Python program to count frequency of a given element in a list of numbers
WAP to count frequency of a given element in a list of numbers.
Solution
L=[2,58,95,999,65,32,15,1,7,45]
n=int(input("Enter the number : "))
print("The frequency of number ",n," is ",L.count(n))
Output/ Explanation:
Enter the number : 3
The frequency of number 3 is 0
--------------------------------------------------------
Enter the number : 58
The frequency of number 58 is 1