CSCA08H3 Lecture 9: Week 9 Notes

152 views8 pages
1 Mar 2016
School
Course
Professor

Document Summary

So the number is not divided by zero because python rst checks if the number is equal to zero or not. We now get another error, though because 4 is divisible by -2 and it should have been included in the example return. So when we change the returned value to the second example case to [-2, 2], and run a doctest, we get no failures. We can also include the code to the right in the module we are creating. This way, when we run the module, the test cases are automatically executed. If they all pass, there is no output in the shell so we know it"s the functions are working. Recall our two palindrome functions we tested. Now let"s say we have two modules with different approaches to calculating palindromes. The rst module contains an input request for a word.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents