MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / isOdd

Function isOdd

other/primelib.py:252–262  ·  view source on GitHub ↗

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

(number)

Source from the content-addressed store, hash-verified

250# ------------------------
251
252def isOdd(number):
253 """
254 input: integer 'number'
255 returns true if 'number' is odd, otherwise false.
256 """
257
258 # precondition
259 assert isinstance(number, int), "'number' must been an int"
260 assert isinstance(number % 2 != 0, bool), "compare bust been from type bool"
261
262 return number % 2 != 0
263
264# ------------------------
265

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected