5.8. Exercises
The exercises in this chapter may first be implemented as applications. Once full functionality and correctness have been verified, we recommend that the reader convert his or her code to functions which can be used in future exercises. On a related note, one style suggestion is to not use print statements in functions. Instead, have the functions return the appropriate value and have the caller perform any output desired. This keeps the code adaptable and reusable.
5-1. Integers. Name the differences between Python's plain and long integers.
5-2. Operators. (a) Create a function to take two numbers (any type) and output their sum.
(b) Write another function, but output the product of two given numbers.
5-3. Standard Type Operators. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access