feza
feza

Reputation: 13

Python Arithmetic sequence

I am trying to make an arithmetic sequence in python with the following code:

sum1 = 330(3 + 990)/2

However, I get the following error:

TypeError: "'int' object is not callable"

How should I do this correctly? Thanks in advance.

Upvotes: 0

Views: 609

Answers (2)

Aesthete
Aesthete

Reputation: 18848

330(

Thinks you are trying to call a function on 330, which is an int. If you're trying to multiply, it should be:

330 * (3 + 990)/2

Upvotes: 3

NPE
NPE

Reputation: 500307

If you are looking for multiplication, the symbol to use is *:

sum1 = 330*(3 + 990)/2
          ^ THIS

Upvotes: 1

Related Questions