Saved Bookmarks
| 1. |
What is the use of duck typing?(a) More restriction on the type values that can be passed to a given method(b) No restriction on the type values that can be passed to a given method(c) Less restriction on the type values that can be passed to a given method(d) Makes the program code smaller |
|
Answer» The correct choice is (c) Less restriction on the type values that can be passed to a given method The explanation: In Python, any set of classes with a common set of methods can be treated similarly. This is called duck typing. Hence duck typing imposes less restrictions. |
|