MCPcopy Create free account
hub / github.com/geekcomputers/Python / isOdd

Function isOdd

primelib/primelib.py:264–274  ·  view source on GitHub ↗

input: integer 'number' returns true if 'number' is odd, otherwise false.

(number)

Source from the content-addressed store, hash-verified

262
263
264def isOdd(number):
265 """
266 input: integer 'number'
267 returns true if 'number' is odd, otherwise false.
268 """
269
270 # precondition
271 assert isinstance(number, int), "'number' must been an int"
272 assert isinstance(number % 2 != 0, bool), "compare bust been from type bool"
273
274 return number % 2 != 0
275
276
277# ------------------------

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected