Hey guys! I want to write a program that finds the sum of cubed terms. i.e. 1**3 + 2**3 + n**3 I wrote down the following code: n = input('Give the value of n.') n = int (n) s = ((n(n+1))/2)**2 print ('Sum equals =', s) The output I got: raceback (most recent call last): File "/Users/apple/Documents/tryin.py", line 15, in <module> s = ((n(n+1))/2)**2 TypeError: 'int' object is not callable >>> Would really appreciate some help guys. :D And any suggestions on what to practice to be better at coding and stop getting these errors will be of help. :) Thanks!
s = ((n * (n + 1)) / 2) ** 2
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)