List of Objects-Level1|Assignment Set-2|Object Oriented Programming Using Python|Infosys Springboard

preview_player
Показать описание
#naanmudhalvan #infosys #springboard
#answers
#objectorientedprogrammingusingpython
#answersdotcom
#listofobjects
Assignment on List of Objects - Level 1
Problem Statement
A telecom company wants to generate reports on the call details of the customers.
The data of each call detail include the phone number which made the call, phone number which was called, duration of the call and the type of call. Data of such calls are provided as a list of comma separated string.

Problem Statement:

Complete the CallDetail class with necessary attributes
Complete the logic inside the parse_customer() method of the Util Class. This method should accept a list of string of the call details and convert it into a list of CallDetail object and assign this list as a value to the attribute of the Util class.
Рекомендации по теме
Комментарии
Автор

class CallDetail:
def __init__(self, phoneno, called_no, duration, call_type):
self.__phoneno=phoneno
self.__called_no=called_no
self.__duration=duration
self.__call_type=call_type



class Util:
def __init__(self):


def parse_customer(self, list_of_call_string):
self.list_of_call_objects=[]
for i in list_of_call_string:
phoneno, called_no, duration, call_type=map(str, i.split(", "))
self.list_of_call_objects.append(CallDetail(phoneno, called_no, duration, call_type))





list_of_call_string=[call, call2, call3]

answersdotcom-bglx
visit shbcf.ru