{"id":12421,"date":"2021-10-01T10:00:51","date_gmt":"2021-10-01T04:30:51","guid":{"rendered":"https:\/\/python-programs.com\/?p=12421"},"modified":"2021-11-22T18:33:30","modified_gmt":"2021-11-22T13:03:30","slug":"python-program-to-calculate-the-average-of-a-numbers-digits-of-every-number-in-given-list","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-calculate-the-average-of-a-numbers-digits-of-every-number-in-given-list\/","title":{"rendered":"Python Program to Calculate the Average of a Number\u2019s digits of Every Number in Given List"},"content":{"rendered":"

Given a list, the task is to calculate the average of every number digit in the given List in Python.<\/p>\n

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

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

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

Given list =[9, 15, 21, 356, 3243, 9139, 4467285, 123456, 5783892, 4535363, 69]<\/pre>\n

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

The list before calculating Average of digits =  [9, 15, 21, 356, 3243, 9139, 4467285, 123456, 5783892, 4535363, 69]\r\nThe list after calculating Average of digits =  [9.0, 3.0, 1.5, 4.666666666666667, 3.0, 5.5, 5.142857142857143, 3.5, 6.0, 4.142857142857<\/pre>\n

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

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

Given list = [245, 1739, 102, 199, 488, 58]<\/pre>\n

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

The list before calculating Average of digits = [245, 1739, 102, 199, 488, 58]\r\nThe list after calculating Average of digits = [3.6666666666666665, 5.0, 1.0, 6.333333333333333, 6.666666666666667, 6.5]<\/pre>\n

Program to Calculate the Average of a Number\u2019s digits of Every Number in Given List in Python<\/h2>\n

Below are the ways to Calculate the Average of a Number\u2019s digits of Every Number in the given List in Python<\/p>\n