0
wrtire a program for cube of first n natural number, what problem with my logic
n=int(input("Enter an integer=")) sum=0 for i in range(1+n+1): sum=sum+(i*i*i) print("sum=",sum)
2 Respuestas
+ 2
Hi Abhishek!
You have to separate function parameters using "," not "+".
I mean your range function needs to be like this,
for i in range(1,n+1):
A cube number is a number multiplied by itself 3 times.
0
What does the question want you to do with those "cubes" ?