---
# System prepended metadata

title: Untitled

---

``` python
# a
def mult (n):
    if n%2 == 1:
        n = -n
    print ("(-1)^n * n =", n)
mult(3)

# b
def sum (n):
    sum_value = 0
    exp = 1
    for i in range(1, n+1):
        exp = exp * -1
        sum_value = sum_value + (exp / i)
    print (sum_value)

sum (3)

# c
def punkt_c (n, x):
    sum = 0
    for i in range(1, n+1):
        inner_sum = 1
        for j in range(1, i+1):
            inner_sum = inner_sum * x
        sum = sum + inner_sum * i
    print (sum)
    
punkt_c(2, 3)  

```