Division by zero is always a problem. Update the preceding function
to check if length is 0. If so, it should output an error message and
return the special value None. Or you can use the statement:
raise ZeroDivisionError(string)
where string contains the error message. This will result in a
typical Python error message similar to the ones we first saw in
Chapter 2.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here