Program to find the number of times an element occurs in a list.
Class 11th CBSE
Assignment
Q-10. Program to find the number of times an element occurs in a list.
Solution :-
#program to find the second largest number of list
# declaring the list
l =[]
#Number of elements will be entered by the user
n = int(input(“Enter the number of elements in the list:”))
# for loop to take the input
for i in range(0,n):
# The input is taken from the user and added to the list as the item
l.append(int (input(“Enter the item:”)))
print(“printing the sum of the list items..”)
ch = int(input(“Ente the number you want to count :- “))
count = l.count(ch)
print(“The number of time number count :- “,count)
Output :-
TRY THIS CODE
Fun & Easy to follow
Works on all devices
Your own Pace
Super Affordable
Popular Videos
Play Video
UX for Teams
Learn the basics and a bit beyond to improve your backend dev skills.
Chris Matthews
Designer
Play Video
SEO & Instagram
Learn the basics and a bit beyond to improve your backend dev skills.
Chris Matthews
Designer