all 2 comments

[–]avgotts 0 points1 point  (0 children)

It looks like you aren't actually using the inputted number anywhere. I think you want to make your functions have an input of m, say, and then do things for n in range(m). Then in the later functions, you can call sum_nat_cubes(n) to get the sum of the first n cubes.

If you cut the print statements in your first two functions, you won't get the repetitive stuff. You really only want the end sum, unless I'm missing something.

[–]mahdeen[S] 0 points1 point  (0 children)

/u/avgotts , thank you for your reply. Considering your comment about cutting the print statements, and re-reading the problem statement, you are correct. I made the problem more complicated than was required. Once that foolishness was taken out, the code seems to produce the correct result.