Anonymous user
Category:Python: Difference between revisions
→Notes
(parampass=[http://docs.python.org/2/tutorial/controlflow.html#defining-functions call by object reference]) |
(→Notes) |
||
Line 13:
It is easy to create clean bug-free programs in Python due to the motto: "Errors should never pass silently." Python is an [[wp:Interpreter (computing)|interpreter]]. Python source files (.py files) are typically compiled to an intermediate [[bytecode]] language (.pyc files) and executed by a Python Virtual Machine.
=Complete the implementation of the stub function q1_mod_inverse(a, n) according to the following specification:
if there exists a multiplicative inverse of a (mod n) then it should return that value, even if it is negative;
if there is no multiplicative inverse of a (mod n) it should return the special value None
You may implement (and call from q1_mod_inverse(a, n)) any additional function required to assist in this task.
If your implementation does not correspond to the specification above (for instance, if you obtain a solution from the web, but do not correctly adapt it) then you will receive zero. Hint: You do not need to go beyond the materials provided in this unit for a solution.
==See Also==
|