Here's the problem:
Write a program that asks the user for two numbers. Using a for loop, add all of the numbers from the first to the second. For example, if the first number is 6 and the second number is 8 the result is 21 (6 + 7 + 8). Print out the results when you are finished.
My code doesn't work though and I've been trying for a while now.
sum = 0
first_num = int(input("First number: "))
second_num = int(input("Second number: "))
for i in range(first_num, second_num):
sum += i
print("Sum is: " + str(sum))
In my code, If I put 6 and 8 it will give me 13, not 21.