frequency of element in array formula code example
Example: frequency of ele in arr
n=int(input("ENTER ARRAY SIZE "))
arr=[]
print("Enter the array elements")
for i in range(n):
arr.append(int(input()))
x=list(dict.fromkeys(arr))
for i in x:
print("\n {} occurs {} time(s)".format(i,arr.count(i)))