Hi friends

help me with the following code. Im able to execute the code but getting wrong 
output

def sequence_b(N):
    N = 10
    result = 0
    for k in xrange (1,N):
        result  +=  ((-1) ** (k+1))/2*k-1
        print result
print sequence_b(10)

This is the output which im getting
-1
-4
-5
-10
-11
-18
-19
-28
-29


But i want output as
1
-1/3
1/5
-1/7
1/9
-1/11
1/13
-1/15
1/17
-1/19


-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to