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
Get step-by-step solutions from verified subject matter experts
