Question: What change needs to be made in the following code segment so that lName will have a default value of unknown? class PhoneNumber : def

What change needs to be made in the following code segment so that lName will have a default value of "unknown"?

class PhoneNumber : def __init__(self, lName, phone = "215-555-1212") : self._name = lName self._phone = phone 

Answer Choices:

A. Replace self._name = lName with self._name = "unknown"
B. Replace the lName parameter with lName = "unknown"
C. Add name = "unknown" to the end of the constructor
D. Add self._lName = "unknown" to the end of the constructor

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!