Question: Question 6: Running Tally (4 points) Write a function RunningTally that takes in two integers: start and end. The function should go through the numbers

Question 6: Running Tally (4 points) Write a function RunningTally that takes in two integers: start and end. The function should go through the numbers in the range specified by the start and end. If the number is even then add it to a running tally, if the number is odd then subtract half of the number from the tally. If the range of integers given is invalid, return zero from this function. Figuring out what an "invalid range" means in this context is part of the test. ]: def RunningTally(start, end): return # YOUR CODE HERE raise NotImplementedError() == ]: print("Test case 1 : RunningTally(10,3) print("Test case 2: abs(RunningTally(20,60) - 440.0)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
