I am designing a program in python to calculate the sum from n to m of i, and for this I am using "for x in range (n, m)".
print("Este programa calcula la sumatoria desde n hasta m de i.\n\nA
continuación ingrese los límites:")
print("")
n = int(input("Ingrese un valor para el límite inferior (n):"))
m = int(input("Ingrese un valor para el límite superior (m):"))
if n < m:
for x in range(n,m):
sumatoria = n + x:
print ("el valor de la sumatoria es " + str(sumatoria))
else:
print("el límite superior debe ser mayor que el inferior.")
Apparently there is a problem with n and x since syntax error appears. Could someone explain to me what is going wrong?
Thank you.