How to write a function in Phython that take two numbers x and y and returns the sum of numbers from x to y
Code that does not work:
def main():
first_number = int(input("Enter x: ")) # the input() function returns a string;
second_number = int(input("Enter y: "))
print(sum_between(x, y))
def sum_between(x, y):
nums_between = range(x, y + 1)
return sum(nums_between)
main()
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here