Exercise 1: Sum All Numbers

Now, let's put what we've learned about loops to work!

Drag and drop the code below to write a sum_all_numbers(x, y) function that takes two numbers, x and y, and returns the sum of all numbers between x and y (inclusive). Below are a few example inputs:


>>> sum_all_numbers(1, 4)
10
>>> sum_all_numbers(2, 3)
5
        


You can reorder the blocks and drag them to different indentation levels as you wish. You may not need to use all of the provided lines.

Get feedback Export

Before you leave this page, be sure to check your answer for correctness by clicking "Get feedback" above and export your code using the "Export button." After you have exported your code, make sure you copy and paste it into the starter code file under excercise 1 def sum_all_numbers