Arithmetic/Integer: Difference between revisions

m
Line 343:
(In general it's good practice to perform parsing of all input in exception handling blocks. This is especially true of interactive user input, but also applies to data read from configuration and other files, and marshaled from other processes via any IPC mechanism).
 
Python also has the procedure ''divmod'' that returns both quotient and remainder. eg
quotient, remainder = divmod(355,113)
Giving a quotient of 3, and a remainder of 16.
 
=== Python 3.0 compatible code ===