Below is the implementation:<\/strong><\/p>\n# given list\r\ngiven_list = [\"my\", \"name\", \"is\", \"BTechGeeks\",\r\n \"coding\", \"platform\", \"for\", \"BTechGeeks\"]\r\n# given element\r\ngiven_element = \"BTechGeeks\"\r\n# Take a variable which stores the count of the element\r\n# say totalCount and initialize it to 0.\r\ncountEleme = 0\r\n# Traverse the given list using for loop.\r\nfor value in given_list:\r\n # if the value is equal too given_element then increase the countEleme by 1\r\n if(value == given_element):\r\n countEleme = countEleme+1\r\n# Print the countEleme\r\nprint(\"The count of the element '\", given_element,\r\n \"' in the list\", given_list, \"=\", countEleme)\r\n<\/pre>\nOutput:<\/strong><\/p>\nThe count of the element ' BTechGeeks ' in the list ['my', 'name', 'is', 'BTechGeeks', 'coding', 'platform', 'for', 'BTechGeeks'] = 2<\/pre>\nMethod #2: Using Count() function<\/h3>\n Approach:<\/strong><\/p>\n\nScan the given list or give list input as static.<\/li>\n Scan the given element or give given element as static.<\/li>\n Count the given element in the list using count() function.<\/li>\n Print the countEleme<\/strong>.<\/li>\n<\/ul>\nBelow is the implementation:<\/strong><\/p>\n# given list\r\ngiven_list = [\"my\", \"name\", \"is\", \"BTechGeeks\",\r\n \"coding\", \"platform\", \"for\", \"BTechGeeks\"]\r\n# given element\r\ngiven_element = \"BTechGeeks\"\r\n# Count the given element in the list using count() function.\r\ncountEleme = given_list.count(given_element)\r\n# Print the countEleme\r\nprint(\"The count of the element '\", given_element,\r\n \"' in the list\", given_list, \"=\", countEleme)\r\n<\/pre>\nOutput:<\/strong><\/p>\nThe count of the element ' BTechGeeks ' in the list ['my', 'name', 'is', 'BTechGeeks', 'coding', 'platform', 'for', 'BTechGeeks'] = 2<\/pre>\nMethod #3: Using Counter() function<\/h3>\n Approach:<\/strong><\/p>\n\nScan the given list or give list input as static.<\/li>\n Scan the given element or give given element as static.<\/li>\n Use Counter function which stores the frequency as values and element as keys in its dictionary<\/li>\n Print the value of the given element<\/li>\n<\/ul>\nBelow is the implementation:<\/strong><\/p>\n# importing counter function from collections\r\nfrom collections import Counter\r\n# given list\r\ngiven_list = [\"my\", \"name\", \"is\", \"BTechGeeks\",\r\n \"coding\", \"platform\", \"for\", \"BTechGeeks\"]\r\n# given element\r\ngiven_element = \"BTechGeeks\"\r\n# Using counter function\r\nfreqValues = Counter(given_list)\r\n# Count the given element in the list\r\ncountEleme = freqValues[given_element]\r\n# Print the countEleme\r\nprint(\"The count of the element '\", given_element,\r\n \"' in the list\", given_list, \"=\", countEleme)\r\n<\/pre>\nOutput:<\/strong><\/p>\nThe count of the element ' BTechGeeks ' in the list ['my', 'name', 'is', 'BTechGeeks', 'coding', 'platform', 'for', 'BTechGeeks'] = 2<\/pre>\nMethod #4:Using List Comprehension<\/h3>\n Approach:<\/strong><\/p>\n\nScan the given list or give list input as static.<\/li>\n Scan the given element or give given element as static.<\/li>\n Using list Comprehension checking if given element is equal to the iterator value<\/li>\n The count of the length of this new list gives the required answer<\/li>\n<\/ul>\nBelow is the implementation:<\/strong><\/p>\n# given list\r\ngiven_list = [\"my\", \"name\", \"is\", \"BTechGeeks\",\r\n \"coding\", \"platform\", \"for\", \"BTechGeeks\"]\r\n# given element\r\ngiven_element = \"BTechGeeks\"\r\n# Using list comprehension\r\nelementlist = [eleme for eleme in given_list if eleme == given_element]\r\n\r\n# Count the given element in the list using len function\r\ncountEleme = len(elementlist)\r\n# Print the countEleme\r\nprint(\"The count of the element '\", given_element,\r\n \"' in the list\", given_list, \"=\", countEleme)\r\n<\/pre>\nOutput:<\/strong><\/p>\nThe count of the element ' BTechGeeks ' in the list ['my', 'name', 'is', 'BTechGeeks', 'coding', 'platform', 'for', 'BTechGeeks'] = 2<\/pre>\n","protected":false},"excerpt":{"rendered":"Our website provided core java programs examples with output aid beginners and expert coders to test their knowledge gap and learn accordingly. Lists in Python: The Python list is a straightforward ordered list of items. Python lists are extremely powerful since the objects in them do not have to be homogeneous or even of the …<\/p>\n
Python Program to Search the Number of Times a Particular Number Occurs in a List<\/span> Read More »<\/a><\/p>\n","protected":false},"author":7,"featured_media":8506,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[5,6],"tags":[],"yoast_head":"\nPython Program to Search the Number of Times a Particular Number Occurs in a List - Python Programs<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n \n\t \n\t \n\t \n