Python Exercises

1. Summing things up Create a module named “sums.py” with three functions in it. These functions are named as follows sum_to(end) sum_of_even(end) sum_of_odd(end) The module should be loadable from the REPL, sample usage is as follows >>> import sums >>> sums.sum(100) Sum of numbers from 1 to 100 is 4950 >>> sums.sum_of_even(100) “Your answer here” >>> exer1.sum_of_odd(100) “Your answer here” You should also be able to run the module as a script, like so
Read more...