def sum_cubes(n):
if n <= 0:
if n < 0:
raise ValueError
else:
return 0
else:
return n ** 3 + sum_cubes(n-1)
if __name__ == "__main__":
print sum_cubes(10)

and a non recursive way

def sum_cubes2(n):
if n < 0:
raise ValueError
res = 0
while n:
res += n ** 3
n -= 1
return res

hi! I want to create a procedure which execute given below query using dynamic sql. i am getting some error i.e. "Msg 156, Level 15, State 1, Line 1
Incorrect ...

public class Main {
public static void main(String[] args) {
long timeCheck;
long periodOfTime;
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(2);
long initialDelay = 0; // ...