Q. Write a program to find the mode, from a given list.

 

Answer =

 

lst = eval(input ("Enter the List :- "))
feq = []
for i in lst :
    feq += [lst.count(i)]
feq.sort()
for i in lst :
    if feq[-1] == lst.count(i):
        print("Mode = ",i)
        break

 

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post