In: Computer Science
##You have received the phone bill.
##You have 4 phones on your family plan.
##You think that some members of the
##family are using too much data.
##
##You would like to calculate the following
##for each of the family members:
## lowest number of minutes used
## highest number of minutes used
## average number of minutes used
##
##The following list (named phonebill) consists
##of 4 lists, each detailing the name of the family
##member, the number of minutes that family member
##used during the week (7 days) and the phone
##number of that person
phonebill = [
["Kiera", [11,21,13,14,15,60,38], "508-111-1110"],
["Lorenzo", [20,12,33,26,37,62,70],"508-111-1111"],
["Mabel", [31,27,43,7,52,68,5],"508-111-1112"],
["Nikolai", [8,7,212,28,114,30,39],"508-111-1113"]
]
##you are to calculate the following for each family
##member and append it to the list of information
##for that family member:
## lowest number of minutes used
## highest number of minutes used
## average number of minutes used
##The list phonebill will be as follows after your program executes
[['Kiera', [11, 21, 13, 14, 15, 60, 38], '508-111-1110', 11, 60, 24.571428571428573],
['Lorenzo', [20, 12, 33, 26, 37, 62, 70], '508-111-1111', 12, 70, 37.142857142857146],
['Mabel', [31, 27, 43, 7, 52, 68, 5], '508-111-1112', 5, 68, 33.285714285714285],
['Nikolai', [8, 7, 212, 28, 114, 30, 39], '508-111-1113', 7, 212, 62.57142857142857]
]
Please done in Python format
Thanks for the question. Below is the code you will be needing. Let me know if you have any doubts or if you need anything to change. If you are satisfied with the solution, please leave a +ve feedback : ) Let me know for any help with any other questions. Thank You! =========================================================================== phonebill = [ ["Kiera", [11, 21, 13, 14, 15, 60, 38], "508-111-1110"], ["Lorenzo", [20, 12, 33, 26, 37, 62, 70], "508-111-1111"], ["Mabel", [31, 27, 43, 7, 52, 68, 5], "508-111-1112"], ["Nikolai", [8, 7, 212, 28, 114, 30, 39], "508-111-1113"] ] for member in phonebill: stats = member[1] lowest,highest,average = min(stats),max(stats),sum(stats)/len(stats) member.append(lowest) member.append(highest) member.append(average) print(phonebill)
===============================================================