Frequency | count () | python

Take out the frequency of given interval of number:

1,2,2,3,1,4,4,1,4,4,6,6,5,7,9,7,1,2,3,5,4,9,7,3

 Solution:

a=[1,2,2,3,1,4,4,1,4,4,6,6,5,7,9,7,1,2,3,5,4,9,7,3]
n=input("enter the no:\n")
n=int(n)
print("The frequency",n,"is",a.count(n))

Output:

Example-

Comments

Post a Comment

Give your feedback!
DO NOT SPAM !!
NO THIRD PARTY PROMOTIONAL LINK !!!! (else comment will be deleted.)

Popular posts from this blog

TOP 10 PROGRAMMING LANGAUAGES COMMING 2021 | ARTICLE

Write a C-program to swap two number:

Print Fibonacci Series using Recursion | C program :