From f16de9422294342a11b803f4451af5237777af97 Mon Sep 17 00:00:00 2001 From: Katy Huff Date: Sun, 13 Jan 2013 11:43:15 -0600 Subject: [PATCH] changes value to type error --- python/testing/Readme.md | 12 ++++++------ python/testing/mean.py | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/python/testing/Readme.md b/python/testing/Readme.md index 12bb6c2..30afea6 100644 --- a/python/testing/Readme.md +++ b/python/testing/Readme.md @@ -72,8 +72,8 @@ def mean(numlist): try: total = sum(numlist) length = len(numlist) - except ValueError: - print "The number list was not a list of numbers." + except TypeError: + raise TypeError("The number list was not a list of numbers.") except: print "There was a problem evaluating the number list." return total/length @@ -87,8 +87,8 @@ def mean(numlist): try: total = sum(numlist) length = len(numlist) - except ValueError: - print "The number list was not a list of numbers." + except TypeError: + raise TypeError("The number list was not a list of numbers.") except: print "There was a problem evaluating the number list." return total/length @@ -112,8 +112,8 @@ def mean(numlist): try: total = sum(numlist) length = len(numlist) - except ValueError: - print "The number list was not a list of numbers." + except TypeError: + raise TypeError("The number list was not a list of numbers.") except: print "There was a problem evaluating the number list." return total/length diff --git a/python/testing/mean.py b/python/testing/mean.py index c04a0f1..887484d 100644 --- a/python/testing/mean.py +++ b/python/testing/mean.py @@ -2,8 +2,8 @@ def mean(numlist): try: total = sum(numlist) length = len(numlist) - except ValueError: - print "The number list was not a list of numbers." + except TypeError: + raise TypeError("The number list was not a list of numbers.") except: print "There was a problem evaluating the number list." return total/length -- 2.26.2