May 2019
Beginner
528 pages
29h 51m
English
10.1 (What’s Wrong with This Code?) What is wrong with the code in the following IPython session?
In [1]: try:...: raise RuntimeError()...: except Exception:...: print('An Exception occurred')...: except RuntimeError:...: print('A RuntimeError occurred')...:An Exception occurred
10.2 (Account Class with Read-Only Properties) Modify Section 10.2.2’s Account class to provide read-only properties for the name and balance. Rename the class attributes with single leading underscores. Re-execute Section 10.2.2’s IPython session to test your updated class. To show that name and balance are read-only, try to assign new values to them.
10.3 (Time Class Enhancement) Modify Section 10.4.2’s Time class to provide a read-only property ...
Read now
Unlock full access