{"id":21506,"date":"2021-09-22T17:36:43","date_gmt":"2021-09-22T12:06:43","guid":{"rendered":"https:\/\/python-programs.com\/?p=21506"},"modified":"2021-11-22T18:36:12","modified_gmt":"2021-11-22T13:06:12","slug":"python-program-to-find-elements-larger-than-half-of-the-elements-in-an-array-list","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-find-elements-larger-than-half-of-the-elements-in-an-array-list\/","title":{"rendered":"Python Program to Find Elements Larger than Half of the Elements in an Array\/List"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Sort the Given Matrix<\/a><\/p>\n

Given a list and the task is to find the elements in a list that are greater than half of the total number of elements in the given list.<\/p>\n

In the case of odd elements, we must print elements greater than floor(n\/2) where n is the total number of elements in the given list.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given List = [4, 6, 3, 1, 8, 9]<\/pre>\n

Output:<\/strong><\/p>\n

The elements in a list that are greater than half of the total number of elements in the given list\r\n6\r\n8\r\n9<\/pre>\n

Explanation<\/strong>:<\/p>\n

Here the elements which are greater than 4 are 6,8,9<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given List =  [1, 0, 6, 9, 3, 4, 2, 6, 3]<\/pre>\n

Output:<\/strong><\/p>\n

The elements in a list that are greater than half of the total number of elements in the given list\r\n3\r\n4\r\n6\r\n6\r\n9<\/pre>\n

Program to Find Elements Larger than Half of the Elements in an Array\/List in Python<\/h2>\n

Below are the ways to find the elements in a list that are greater than half of the total number of elements in the given list:<\/p>\n