#TypeError: 'int' object is not callable

5 messages · Page 1 of 1 (latest)

royal moat
#

i'm doing some excercise i found , i understand what the error means but i can't understan what is wrong in the code i wrote
here is the code:
number=int(input("introduzca un numero positivo entero: "))
suma=(number(number + 1)) / 2;

print(suma)

the excercise is:
Write a program that reads a positive integer, n , entered by the user and then displays the sum of all integers from 1 to n.

wooden tartan
#

In maths, when you have ab, we know that ab is actually a * b, likewise a(b+1) we know as a * (b+1)

#

But python doesn't know that

#

You need to use the multiplication sign