If your code encounters a condition it doesn't know how to handle, such as an incorrect parameter, it should raise the appropriate exception.
if odds % 2 != 1:
raise ValueError("Did not get an odd number")
return odds + 1
Get monthly updates about new articles, cheatsheets, and tricks.