Find the total from a range #
Write a function that takes a range given as a list of two numbers and calculates the sum of all the numbers within that range, including the start and the end of the range.
Example #
calculate_range_sum([1, 5]) returns the number 15. The range [1, 5] includes the numbers 1, 2, 3, 4, and 5. The sum of these numbers is 15.
Tests #
calculate_range_sum([1, 5])should return15calculate_range_sum([10, 0])should return55calculate_range_sum([-5, -1])should return-15calculate_range_sum([0, -10])should return-55calculate_range_sum([105, 100])should return615
Getting Started with Python
Data Types
Python Functions
Statements in Python
Basic Debugging in Python
Basic Algorithm
Object-Oriented Programming
Error Handling
Intermediate Algorithm
Python Modules