def reverse_list(i=[]):
    i = 0
    new_list = []
    while i < len(1):
        new_list.append((1)[len(1) - i - 1])
        i = i + 1
    return new_list

Recursively reverse a list of elements.


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)


def reverse_list(l):
    if len(l) == 0:
        return []
    return [l[-1]] + reverse_list(l[:-1])

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def sumup(n):
    if n == 0:
        return 0
    return n + sumup(n - 1)

Return the sum of all integers up to n.

assert sumup(0)==0 and sumup(1)==1 and sumup(2)==3 and sumup(10)==55 and sumup(27)==378


Return the sum of all integers up to n.


def factorial(n):
    if n == 0:
        return 1
    return n * factorial(n - 1)

Compute the factorial of the given number.

assert factorial(-1)==1 and factorial(0)==1 and factorial(1)==1 and factorial(2)==2 and factorial(5)==120 and factorial(20)==2432902008176640000


def power(m, n):
    if n == 0:
        return 1
    n -= -1
    return m * power(m, n)


def power(m, n):
    if n == 0:
        return 1
    n -= 1
    return m * power(m, n)


def minimum(l):
    if len(l) == 0:
        return None
    return min(l)

Return the minimum element in a list of numbers.


def minimum(l):
    if len(l) == 1:
        return l[0]
    minn = minimum(l[:-1])
    if l[-1] < minn:
        return l[-1]
    else:
        return minn


def maximum(l):
    if len(l) == 1:
        return l[0]
    maxn = maximum(l[:-1])
    print(l[:-1])
    if l[-1] > maxn:
        return l[-1]
    else:
        return maxn

Return the maximum element in a list of numbers.


def maximum(l):
    if len(l) == 1:
        return l[0]
    maxn = maximum(l[:-1])
    if l[-1] > maxn:
        return l[-1]
    else:
        return maxn


def count_letters(s):
    if not s:
        return 0
    return 1 + count_letters(s[:-1])

Return the number of lettres in a string.

assert count_letters('')==0 and count_letters('0')==1 and count_letters('##')==2 and count_letters('t')==1 and count_letters('fqfseqfseqsse')==13


def reverse_list(l):
    if not len(l):
        return []
    return [l[-1]] + reverse_list(l[:-1])

Recursively reverse a list of elements.


def fibonacci(n):
    if any([n == 0, n == 1]):
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)

Recursively compute the value of the fibonacci series at position n.

assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657


def sumup(N):
    if N == 0:
        return 0
    return N + sumup(N - 1)

Return the sum of all integers up to n.


def factorial(N):
    if N == 0:
        return 1
    return N * factorial(N - 1)


def power(n, p):
    if p == 0:
        return 1
    return n * power(n, p - 1)


def factorial(n):
    if n == 0:
        return 0
    return n * factorial(n - 1)


def factorial(n):
    if n == 0:
        return 0
    return n + n * factorial(n - 1)


def power(m, n):
    if n == 0:
        return 1
    return m + m * power(m, n - 1)


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)


def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)

def minimum(l):
    A = l
    p = 0
    r = len(A) - 1
    return quicksort(A, p, r)[0]


def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)

def minimum(l):
    A = l
    p = 0
    r = len(A) - 1
    return quicksort(A, p, r)


def quicksort(A, p, r):
    if r <= p:
        return
        q = partition(A, p, r)
        quicksort(A, p, q - 1)
        quicksort(A, q + 1, r)

def minimum(l):
    A = l
    p = 0
    r = len(A) - 1
    return quicksort(A, p, r)


def quicksort(A, p, r):
    if r <= p:
        return A[0]
        q = partition(A, p, r)
        quicksort(A, p, q - 1)
        quicksort(A, q + 1, r)

def minimum(l):
    A = l
    p = 0
    r = len(A) - 1
    return quicksort(A, p, r)


def quicksort(A, p, r):
    if r <= p:
        return A[0]
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)

def minimum(l):
    A = l
    p = 0
    r = len(A) - 1
    return quicksort(A, p, r)


def minimum(l):
    if len(l) == 1:
        return l[0]
    if l[0] <= minimum(l[1:]):
        return l[0]
    else:
        return minimum(l[1:])


def maximum(l):
    if len(l) == 1:
        return l[0]
    if l[0] > l[1]:
        l.remove(l[1])
    else:
        l.remove(l[0])
    return maximum(l)


def count_letters(s):
    if s == '':
        return 0
    return 1 + count_letters(s[1:])


def reverse_list(n):
    if len(1) == 0:
        return []
    return (1)[-1] + reverse_list[:1]

Recursively reverse a list of elements.


def reverse_list(n):
    if len(n) == 0:
        return []
    return n[-1:] + reverse_list[:-1]

Recursively reverse a list of elements.


def reverse_list(n):
    if len(n) == 0:
        return []
    return n[-1:] + reverse_list(n[:-1])

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def fibonacci(n):
    if n == 0:
        return 1
    elif n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def count_letters(s):
    if s == '':
        return 0
    else:
        return 1 + count_letters(s[1:])


def reverse_list(a):
    if len(a) == 0:
        b = list()
        return b
    else:
        b = reverse_list(a[1:])
        b.append(a[0])
        return b

Recursively reverse a list of elements.


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def fibonacci(n):
    if n == 0:
        return 0
    if n == 1:
        return 1
    else:
        fibN_2 = 0
        fibN_1 = 1
        i = 2
        while i <= n:
            fibN = fibN_2 + fibN_1
            fibN_2 = fibN_1
            fibN_1 = fibN
            i = i + 1
        return fibN

Iteratively compute the value of the fibonacci series at position n.


def countdown(num):
    while num >= 1:
        print(num)
        time.sleep(0.1)
        num = num - 1
    print('LIFT OFF!')


def search(str, letter):
    i = 0
    while i < len(str):
        if letter == str[i]:
            return True
        i = i + 1
    return False

Iteratively search for a letter in a string

assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True


def index(str, letter):
    i = 0
    while i < len(str):
        if letter == str[i]:
            return i
        i = i + 1
    return -1

Iteratively search for the position of letter in str, return -1 if it is not there.


def countdown(num):
    if num == 0:
        print('LIFT OFF!')
    else:
        print(num)
        time.sleep(0.1)
        countdown(num - 1)


def index(str, letter, pos):
    if pos == len(str):
        return -1
    elif str[pos] == letter:
        return pos
    else:
        return index(str, letter, pos + 1)

Recursively search for the position of letter in str, return -1 if it is not there.


def search(str, letter):
    if str == '':
        return False
    elif str[0] == letter:
        return True
    else:
        return search(str[1:], letter)

Recursively search for a letter in a string


def fibonacci(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)


def fibonacci(n):
    if n <= 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def count_letters(s):
    if s == '':
        return 0
    return 1 + count_letters(s[1:])


def maximum(a):
    if len(a) <= 1:
        return a[0]
    return max(a[0], maximum(a[1:]))


def minimum(a):
    if len(a) <= 1:
        return a[0]
    return min(a[0], minimum(a[1:]))


def reverse_list(a):
    if len(a) == 0:
        return []
    return [a[-1]] + reverse_list(a[:-1])

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def sumup(n):
    if n == 0:
        return 0
    return n + sumup(n - 1)

Return the sum of all integers up to n.


def factorial(n):
    if n == 0:
        return 1
    return n * factorial(n - 1)


Return the sum of all integers up to n.


def power(num, ter):
    if ter == 0:
        return 1
    ter = ter - 1
    return num * power(num, ter)


def minimum(nums):
    if len(nums) == 1:
        return nums[0]
    smallest = minimum(nums[:-1])
    if nums[-1] < smallest:
        return nums[-1]
    else:
        return smallest


def power(n, p):
    if p == 0:
        return 1
    else:
        return power(n, p - 1) * n


def minimum(l):
    if len(l) == 1:
        return l[0]
    else:
        min_ret = minimum(l[1:])
        return l[0] if l[0] < min_ret else min_ret


def maximum(l):
    if len(l) == 1:
        return l[0]
    else:
        max_ret = maximum(l[1:])
        return l[0] if l[0] > max_ret else max_ret


def count_letters(s):
    if s == '':
        return 0
    else:
        return 1 + count_letters(s[1:])


def reverse_list(l):
    if len(l) == 0:
        return []
    else:
        return [l[-1]] + reverse_list(l[:-1])

Recursively reverse a list of elements.


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def maximum(l):
    if len(l) == 1:
        return l[0]
    f, m = l[0], maximum(l)
    if f > m:
        return f
    else:
        return m


def maximum(l):
    if len(l) == 1:
        return l[0]
    f, m = l[0], maximum(l[1:])
    if f > m:
        return f
    else:
        return m


def reverse_list(l):
    if len(l) == 1:
        return l
    else:
        return reverse_list(l[1:]) + l[0]

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) < 2:
        return l
    else:
        return reverse_list(l[1:]) + l[0]

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) < 2:
        return l
    else:
        return reverse_list(l[1:]) + [l[0]]

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)


def minimum(l):
    if len(l) == 1:
        return l[0]
    else:
        return minimum(l[1:] if l[0] > l[-1] else l[-1])


def sumup(n):
    if n == 0:
        return 0
    return n + sumup(n - 1)

Return the sum of all integers up to n.


Return the sum of all integers up to n.


def minimum(l):
    if len(l) == 1:
        return l[0]
    else:
        return minimum(l[1:] if l[0] > l[-1] else l[:-1])


def maximum(l):
    if len(l) == 1:
        return l[0]
    else:
        return maximum(l[1:] if l[0] < l[-1] else l[:-1])


def count_letters(s):
    if not s:
        return 0
    return 1 + count_letters(s[1:])


def reverse_list(l):
    if len(l) == 0:
        return l
    return l[-1:] + reverse_list(l[:-1])

Recursively reverse a list of elements.


def factorial(n):
    if n == 0:
        return 1
    return n * factorial(n - 1)


def fibonacci(n):
    if n == 0:
        return 1
    if n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def reverse_list(a):
    if len(a) == 0:
        return []
    return reverse_list(a[1:]) + [a[0]]

Recursively reverse a list of elements.


def power(n, m):
    if m == 0:
        return 1
    return n * power(n, m - 1)


def maximum(a):
    if len(a) == 1:
        return a[0]
    la = a[:1]
    ra = a[1:]
    if maximum(la) < maximum(ra):
        return maximum(ra)
    else:
        return maximum(la)


def count_letters(s):
    if len(s) == 1:
        return 1
    elif s == '':
        return 0
    return count_letters(s[:1]) + count_letters(s[1:])


def power(n, t):
    if t == 0:
        return 1
    return n * power(n, t - 1)


def maximum(l):
    if len(l) == 1:
        return l[0]
    elif len(l) == 0:
        return 0
    m = maximum(l[1:])
    if m < l[0]:
        return l[0]
    return m


def minimum(l):
    if len(l) == 1:
        return l[0]
    elif len(l) == 0:
        return 0
    m = minimum(l[1:])
    if m > l[0]:
        return l[0]
    return m


def sumup(n):
    if n == 0:
        return 0
    return sumup(n - 1) + n

Return the sum of all integers up to n.


def reverse_list(l):
    if len(l) == 1:
        return [l[0]]
    return reverse_list(l[1:]) + [l[0]]

Recursively reverse a list of elements.


def power(m, n):
    if n == 0:
        return 1
    return power(m, n - 1) * m


def count_letters(s):
    if s == '':
        return 0
    return count_letters(s[1:]) + 1


def reverse_list(l):
    if len(l) == 1:
        return [l[0]]
    elif len(l) == 0:
        return []
    return reverse_list(l[1:]) + [l[0]]

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def minimum(nums):
    if len(nums) == 1:
        return nums[0]
    minimum_num = minimum(nums[:-1])
    if nums[-1] < minimum_num:
        return nums[-1]
    else:
        return minimum_num


def maximum(nums):
    if len(nums) == 1:
        return nums[0]
    maximum_num = maximum(nums[:-1])
    if nums[-1] > maximum_num:
        return nums[-1]
    else:
        return maximum_num


def fibonacci(n):
    if n == 0:
        return 1
    elif n == 1:
        return 1
    return fibonacci(n - 2) + fibonacci(n - 1)


def count_letters(string):
    if len(string) == 0:
        return 0
    return 1 + count_letters(string[:-1])


def reverse_list(nums):
    if len(nums) == 0:
        new_nums = list()
        return new_nums
    new_nums = reverse_list(nums[1:])
    new_nums.append(nums[0])
    return new_nums

Recursively reverse a list of elements.


def reverse_list(a, i=1, newa=[]):
    if i <= len(a):
        newa.append(a[-i])
        i = i + 1
        return reverse_list(a, i, newa)
    else:
        return newa
        newa = []

Recursively reverse a list of elements.


def reverse_list(a):
    if len(a) == 0:
        return a
    e = a[0]
    a = a[1:]
    b = reverse_list(a) + [e]
    return b

Recursively reverse a list of elements.


def fibonacci(num):
    if num == 0 or num == 1:
        return 1
    return fibonacci(num - 1) + fibonacci(num - 2)


def sumup(n):
    if n == 0:
        return 0
    return n + sumup(n - 1)

Return the sum of all integers up to n.


Return the sum of all integers up to n.


def factorial(n):
    if n == 0:
        return 0
    return n * factorial(n - 1)


def factorial(n):
    if n == 1:
        return 1
    return n * factorial(n - 1)


def factorial(n):
    if n == 0:
        return 1
    return n * factorial(n - 1)


def power(m, n):
    if n == 0:
        return 1
    n -= 1
    return m * power(m, n)


def maximum(nums):
    if len(nums) == 1:
        return nums[0]
    topper = maximum(nums[:-1])
    if nums[-1] > topper:
        return nums[-1]
    else:
        return topper


def reverse_list(nums):
    if len(nums) == 0:
        n = list()
        return n
    n = reverse_list(nums[1:])
    n.append(nums[0])
    return n

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def sumup(n):
    if n == 0:
        return 0
    sum_to_n_minus_1 = sumup(n - 1)
    return n + sum_to_n_minus_1

Return the sum of all integers up to n.


def reverse_list(l):
    if len(l) == 0:
        return []
    return l[-1:] + reverse_list(l[:-1])

Recursively reverse a list of elements.


def power(m, n):
    if n == 0:
        return 1
    power_n_minus_1 = power(m, n - 1)
    return m * power_n_minus_1


def minimum(l):
    if len(l) == 1:
        return l[0]
    if l[0] <= minimum(l[1:]):
        return l[0]
    else:
        return minimum(l[1:])


def maximum(l):
    if len(l) == 1:
        return l[0]
    if l[0] >= maximum(l[1:]):
        return l[0]
    else:
        return maximum(l[1:])


def count_letters(s):
    if s == '':
        return 0
    return 1 + count_letters(s[1:])


def factorial(n):
    if n == 0:
        return 1
    facotrial_n_minus_1 = factorial(n - 1)
    return n * facotrial_n_minus_1


def fibonacci(N):
    if N == 0 or N == 1:
        return 1
    return fibonacci(N - 1) + fibonacci(N - 2)


def factorial(n):
    if n == 0:
        return 1
    elif n == 1:
        return n
    return n * factorial(n - 1)


def minimum(n, i=0):
    j = i
    while j < len(n) and n[j] > n[-1]:
        j += 1
    if j < len(n):
        tmp = n[i]
        n[i] = n[j]
        n[j] = tmp
    if j > len(n):
        return n[0]
    return minimum(n, i + 1)


def sumup(n):
    if n == 0:
        return 0
    return n + sumup(n - 1)

Return the sum of all integers up to n.


Return the sum of all integers up to n.


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)


def minimum(l):
    if len(l) == 1:
        return l[0]
    else:
        return minimum(l[1:] if l[0] > l[-1] else l[:-1])


def maximum(l):
    if len(l) == 1:
        return l[0]
    else:
        return maximum(l[1:] if l[0] < l[-1] else l[:-1])


def count_letters(s):
    if not s:
        return 0
    return 1 + count_letters(s[1:])


def reverse_list(l):
    if len(l) == 0:
        return l
    return l[-1:] + reverse_list(l[:-1])

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def fibonacci(n):
    if n == 0:
        return 1
    if n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def maximum(a):
    if len(a) == 1:
        return a[0]
    return maximum(a.remove(min(a)))


def maximum(a):
    if len(a) == 1:
        return a[0]
    a.remove(min(a))
    return maximum(a)


def factorial(n):
    if n == 0:
        return 1
    return n * factorial(n - 1)


def minimum(a):
    if len(a) == 1:
        return a[0]
    a.remove(max(a))
    return maximum(a)


def minimum(a):
    if len(a) == 1:
        return a[0]
    smallest = minimum(a[1:])
    if a[0] < smallest:
        smallest = a[0]
    return smallest


def minimum(a):
    if len(a) == 1:
        return a[0]
    a.remove(max(a))
    return minimum(a)


def maximum(a):
    if len(a) == 1:
        return a[0]
    biggest = maximum(a[1:])
    if a[0] > biggest:
        biggest = a[0]
    return biggest


def count_letters(s):
    if s == '':
        return 0
    return 1 + count_letters(s[1:])


def reverse_list(a):
    if len(a) == 0:
        return []
    return reverse_list(a[1:]) + [a[0]]

Recursively reverse a list of elements.


def reverse_list(a):
    if len(a) == 1:
        return a
    b = a[1:]
    return reverse_list(b).append(a[0])

Recursively reverse a list of elements.


def reverse_list(a):
    if len(a) == 0:
        return []
    return reverse_list(a).append(a[0])

Recursively reverse a list of elements.


def reverse_list(a):
    if len(a) == 0:
        return []
    return reverse_list(a[1:]).append(a[0])

Recursively reverse a list of elements.


def power(m, n):
    if n == 1:
        return m
    else:
        return m * power(m, n - 1)


def power(m, n):
    if n == 1:
        return m
    if n != 1:
        return m * power(m, n - 1)


def power(m, n):
    if n == 0:
        return 1
    if n != 1:
        return m * power(m, n - 1)


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)


def power(m, n):
    if n == 0:
        return 1
    print(m * power(m, n - 1))
    return m * power(m, n - 1)


def power(m, n):
    if n == 0:
        return 1
    print((m, n))
    return m * power(m, n - 1)


def sumup(n):
    if n == 0:
        return 0
    return n + sumup(n - 1)

Return the sum of all integers up to n.


Return the sum of all integers up to n.


def minimum(l):
    if len(l) == 1:
        return l[1]
    else:
        mnum = minimum(l[1:])
        minn = mnum
        if mnum < minn:
            minn = mnum
        return minn


def minimum(l):
    if len(l) == 1:
        return l[0]
    else:
        mnum = minimum(l[1:])
        minn = mnum
        if mnum < minn:
            minn = mnum
        return minn


def minimum(l):
    if len(l) == 1:
        return l[0]
    else:
        m1 = minimum(l[0:len(l) / 2])
        m2 = minimum(l[len(l) / 2:])
        if m1 < m2:
            return m1
        else:
            return m2


def factorial(n):
    if n == 0:
        return 1
    return n * factorial(n - 1)


def minimum(l):
    if len(l) == 1:
        return l[0]
    else:
        m1 = minimum(l[:len(l) // 2])
        m2 = minimum(l[len(l) // 2:])
        if m1 < m2:
            return m1
        else:
            return m2


def minimum(l):
    if len(l) == 1:
        return l[0]
    else:
        m1 = minimum(l[:len(l) // 2])
        m2 = minimum(l[len(l) // 2:])
        print((m1, m2))
        if m1 < m2:
            return m1
        else:
            return m2


def maximum(l):
    if len(l) == 1:
        return l[0]
    else:
        m1 = minimum(l[:len(l) // 2])
        m2 = minimum(l[len(l) // 2:])
        if m1 > m2:
            return m1
        else:
            return m2


def maximum(l):
    if len(l) == 1:
        return l[0]
    else:
        m1 = maximum(l[:len(l) // 2])
        m2 = maximum(l[len(l) // 2:])
        if m1 > m2:
            return m1
        else:
            return m2


def count_letters(s):
    if s == '':
        return 0
    return 1 + count_letters(s[1:])


def count_letters(s):
    if s == '':
        return 0
    print(s)
    return 1 + count_letters(s[1:])


def power(n, t):
    if t == 0:
        return 1
    t -= 1
    return n * power(n, t)


def minimum(nums):
    if len(nums) == 1:
        return nums[0]
    min_num = minimum(nums[:-1])
    if nums[-1] < min_num:
        return nums[-1]
    else:
        return min_num


def maximum(nums):
    if len(nums) == 1:
        return nums[0]
    max_num = maximum(nums[:-1])
    if nums[-1] > max_num:
        return nums[-1]
    else:
        return max_num


def minimum(l):
    if len(l) == 1:
        return l[0]
    i = 0
    j = 1
    while i < len(l) - 1 and l[i] < l[j]:
        i += 1
        j += 1
    l.pop(i)
    minimum(l)
    return l[0]


def count_letters(string):
    if len(string) == 0:
        return 0
    return 1 + count_letters(string[:-1])


def maximum(l):
    if len(l) == 1:
        return l[0]
    i = 0
    j = 1
    while i < len(l) - 1 and l[i] > l[j]:
        i += 1
        j += 1
    l.pop(i)
    maximum(l)
    return l[0]


def reverse_list(nums):
    if len(nums) == 0:
        new_nums = list()
        return new_nums
    new_nums = reverse_list(nums[1:])
    new_nums.append(nums[0])
    return new_nums

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def fibonacci(num):
    if num == 0 or num == 1:
        return 1
    return fibonacci(num - 1) + fibonacci(num - 2)


def reverse_list(l):
    if len(l) == 0:
        new_l = list()
        return new_l
    new_l = reverse_list(l[1:])
    new_l.append(l[0])
    return new_l

Recursively reverse a list of elements.


def count_letters(s):
    if len(s) == 0:
        return 0
    return 1 + count_letters(s[:-1])


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def sumup(n):
    if n == 0:
        return n
    return n + sum(n - 1)

Return the sum of all integers up to n.


def sumup(n):
    if n == 0:
        return n
    return n + sumup(n - 1)

Return the sum of all integers up to n.


Return the sum of all integers up to n.


def factorial(n):
    if n <= 1:
        return n
    else:
        return n * factorial(n - 1)


def factorial(n):
    if n <= 1:
        return 1
    else:
        return n * factorial(n - 1)


def power(m, n):
    if n == 0:
        return 1
    else:
        return m * (m, n - 1)


def power(m, n):
    if n == 0:
        return 1
    else:
        return sum(m * (m, n - 1))


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)


def count_letters(s):
    if s == '':
        return 0
    else:
        return 1 + count_letters(s[1:])


def fibonacci(n):
    if n == 0:
        return 1
    if n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def reverse_list(a):
    if len(a) == 0:
        return []
    k = a[-1]
    a.pop()
    return [k] + reverse_list(a)

Recursively reverse a list of elements.


def maximum(a):
    if len(a) == 1:
        return a[0]
    if a[0] > a[1]:
        a.remove(a[1])
    else:
        a.remove(a[0])
    return maximum(a)


def minimum(a):
    if len(a) == 1:
        return a[0]
    if a[0] < a[1]:
        a.remove(a[1])
    else:
        a.remove(a[0])
    return minimum(a)


def power(m, n):
    if n == 0 or m == 1:
        return 1
    return m * power(m, n - 1)


def sumup(number):
    if number == 0:
        return 0
    return sumup(number - 1) + number

Return the sum of all integers up to n.


def factorial(number):
    if number == 0:
        return 1
    return factorial(number - 1) * number


def sumup(n):
    if n == 0:
        return 0
    return n + sumup(n - 1)

Return the sum of all integers up to n.


def count_letters(string):
    if len(string) == 0:
        return 0
    return 1 + count_letters(string[:-1])


def factorial(n):
    if n == 0:
        return 1
    return n * factorial(n - 1)


def factorial(n):
    if n == 0:
        return 0
    return n * factorial(n - 1)


Return the sum of all integers up to n.


def power(n, t):
    if t == 0:
        return 1
    t -= 1
    return n * power(n, t)


def minimum(nums):
    if len(nums) == 1:
        return nums[0]
    min_num = minimum(nums[:-1])
    if nums[-1] < min_num:
        return nums[-1]
    else:
        return min_num


def maximum(nums):
    if len(nums) == 1:
        return nums[0]
    max_num = maximum(nums[:-1])
    if nums[-1] > max_num:
        return nums[-1]
    else:
        return max_num


def reverse_list(nums):
    if len(nums) == 0:
        new_nums = list()
        return new_nums
    new_nums = reverse_list(nums[1:])
    new_nums.append(nums[0])
    return new_nums

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def fibonacci(num):
    if num == 0 or num == 1:
        return 1
    return fibonacci(num - 1) + fibonacci(num - 2)


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)


def minimum(a):
    if len(a) == 1:
        return a[0]
    else:
        small = a[0]
        if a[1] < small:
            small = a[1]
            a.remove(a[0])
        else:
            a.remove(a[1])
    return minimum(a)


def maximum(a):
    if len(a) == 1:
        return a[0]
    else:
        big = a[0]
        if a[1] > big:
            big = a[1]
            a.remove(a[0])
        else:
            a.remove(a[1])
    return maximum(a)


def reverse_list(l):
    if len(l) == 0:
        return []
    return [l[-1]] + reverse_list(l[:-1])

Recursively reverse a list of elements.


def reverse_list(n):
    if len(n) == 0:
        return []
    return [l[-1]] + reverse_list(l[:-1])

Recursively reverse a list of elements.


def reverse_list(n):
    if len(n) == 0:
        return []
    return [n[-1]] + reverse_list(n[:-1])

Recursively reverse a list of elements.


def count_letters(s):
    if s == '':
        return 0
    return 1 + count_letters(s[1:])


def fibonacci(n):
    if n == 0:
        return 1
    if n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def fibonacci(n):
    if n < 2:
        return n
    return fibonacci(n - 2) + fibonacci(n - 1)


def fibonacci(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def count_letters(n):
    if n == '':
        return 0
    return 1 + count_letters(n[1:])


def maximum(n):
    if len(n) == 1:
        return n[0]
    h = n[0]
    t = n[1:]
    m = maximum(t)
    if m > h:
        return m
    else:
        return h


def minimum(n):
    if len(n) == 1:
        return n[0]
    h = n[0]
    t = n[1:]
    m = minimum(t)
    if h > m:
        return m
    else:
        return h


def fibonacci(number):
    if number == 0 or number == 1:
        return 1
    return fibonacci(number - 1) + fibonacci(number - 2)


def minimum(l, currmin=None):
    pos = l.pop()
    if currmin == None or pos < currmin:
        return minimum(l, pos)
    return minimum(l, currmin)


def minimum(l, currmin=None):
    if not l:
        return currmin
    pos = l.pop()
    if currmin == None or pos < currmin:
        return minimum(l, pos)
    return minimum(l, currmin)


Recursively reverse a list of elements.


def maximum(l, currmax=None):
    if not l:
        return currmax
    pos = l.pop()
    if currmax == None or pos > currmax:
        return maximum(l, pos)
    return maximum(l, currmax)


def count_letters(word):
    if not word:
        return 0
    else:
        return 1 + count_letters(word[1:])


def factorial(n):
    if n == 0:
        return 1
    return n * factorial(n - 1)


def fibonacci(n):
    if n <= 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def minimum(a):
    if len(a) == 1:
        return a[0]
    h = a[0]
    t = a[1:]
    m = minimum(t)
    if h > m:
        return m
    else:
        return h


def maximum(a):
    if len(a) == 1:
        return a[0]
    h = a[0]
    t = a[1:]
    m = maximum(t)
    if m > h:
        return m
    else:
        return h


def reverse_list(l):
    if len(l) == 0:
        return []
    return [l[-1]] + reverse_list(l[:-1])

Recursively reverse a list of elements.


def sumup(n):
    if n == 0:
        return 0
    return n + sumup(n - 1)

Return the sum of all integers up to n.


Return the sum of all integers up to n.


def reverse_list(a):
    if not a:
        return a
    else:
        return reverse_list(a[1:] + a[0])

Recursively reverse a list of elements.


def reverse_list(a):
    if a == '':
        return a
    else:
        return reverse_list(a[1:] + a[0])

Recursively reverse a list of elements.


def count_letters(s):
    if s == '':
        return 0
    return 1 + count_letters(s[1:])


def fibonacci(num):
    if num == 0 or num == 1:
        return 1
    return fibonacci(num - 1) + fibonacci(num - 2)


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)


def reverse_list(a):
    if len(a) == 0:
        return []
    return [a[-1]] + reverse_list(a[:-1])

Recursively reverse a list of elements.


def reverse_list(a):
    return [a[-1]] + reverse_list(a[:-1]) if a else []

Recursively reverse a list of elements.


def maximum(nums):
    if len(nums) == 1:
        return nums[0]
    max_num = maximum(nums[:-1])
    if nums[-1] > max_num:
        return nums[-1]
    else:
        return max_num


def minimum(nums):
    if len(nums) == 1:
        return nums[0]
    min_num = minimum(nums[:-1])
    if nums[-1] < min_num:
        return nums[-1]
    else:
        return min_num


def power(n, t):
    if t == 0:
        return 1
    t -= 1
    return n * power(n, t)


def reverse_list(nums):
    if len(nums) == 0:
        new_nums = list()
        return new_nums
    new_nums = reverse_list(nums[1:])
    new_nums.append(nums[0])
    return new_nums

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def factorial(n):
    if n == 0:
        return 1
    return n * factorial(n - 1)


def count_letters(string):
    if len(string) == 0:
        return 0
    return 1 + count_letters(string[:-1])


def reverse_list(a):
    if a:
        return [a[-1]] + reverse_list(a[:-1])
    else:
        return []

Recursively reverse a list of elements.


def minimum(l):
    if len(l) == 1:
        return l[0]
    else:
        return minimum(l[1:] if l[0] > l[-1] else l[:-1])


def fibonacci(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def fibonacci(n):
    if n == 0:
        return 1
    elif n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def maximum(l):
    if len(l) == 1:
        return l[0]
    else:
        return maximum(l[1:] if l[0] < l[-1] else l[:-1])


def count_letters(s):
    if not s:
        return 0
    return 1 + count_letters(s[1:])


def reverse_list(list):
    i = 0
    while i <= len(list) // 2:
        list[i], list[len(list) - 1 - i] = list[len(list) - 1 - i], list[i]
        i += 1
    return list

Recursively reverse a list of elements.


def reverse_list(list):
    i = 0
    while i < len(list) // 2:
        list[i], list[len(list) - 1 - i] = list[len(list) - 1 - i], list[i]
        i += 1
    return list

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return []
    return [l[-1]] + reverse_list(l[:-1])

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return l
    return l[-1:] + reverse_list(l[:-1])

Recursively reverse a list of elements.


def fibonacci(n):
    if n == 0:
        return 0
    if n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def fibonacci(n):
    if n == 0:
        return 1
    if n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)


def fibonacci(n):
    if n == 0:
        return 1
    if n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def sumup(n):
    n = n(n + 1) / 2
    return n

Return the sum of all integers up to n.


def sumup(n):
    a = n(n + 1) / 2
    return a

Return the sum of all integers up to n.


def sumup(n):
    if int(n) == 0:
        return '0'
    else:
        return n(n + 1) / 2

Return the sum of all integers up to n.


def sumup(n):
    if int(n) == 0:
        return '0'
    else:
        return int(n(n + 1) / 2)

Return the sum of all integers up to n.


def power(n, p):
    if p == 0:
        return 1
    else:
        return power(n, p - 1) * n


def minimum(l):
    if len(l) == 1:
        return l[0]
    else:
        min_ret = minimum(l[1:])
        return l[0] if l[0] < min_ret else min_ret


def maximum(l):
    if len(l) == 1:
        return l[0]
    else:
        max_ret = maximum(l[1:])
        return l[0] if l[0] > max_ret else max_ret


def sumup(n):
    if int(n) == 0:
        return '0'
    else:
        return sumup(n + 1)

Return the sum of all integers up to n.


def reverse_list(l):
    if len(l) == 0:
        return []
    else:
        return [l[-1]] + reverse_list(l[:-1])

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def sumup(n):
    if int(n) == 0:
        return '0'
    else:
        return n + sumup(n - 1)

Return the sum of all integers up to n.


def sumup(n):
    if int(n) == 0:
        return '0'
    return n + sumup(n - 1)

Return the sum of all integers up to n.


def sumup(n):
    if int(n) == 0:
        return 0
    return n + sumup(n + 1)

Return the sum of all integers up to n.


def sumup(n):
    if int(n) == 0:
        return 0
    return int(n) + sumup(int(n) - 1)

Return the sum of all integers up to n.


def factorial(n):
    if int(n) == 0:
        return 0
    return int(n) * factorial(int(n) - 1)


def factorial(n):
    if int(n) == 1:
        return 1
    return int(n) * factorial(int(n) - 1)


def reverse_list(a):
    if len(a) == 0:
        return a
    e = a[0]
    a = a[1:]
    b = reverse_list(a) + e
    return b

Recursively reverse a list of elements.


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    return fibonacci(n - 2) + fibonacci(n - 1)


def minimum(a):
    if len(a) == 1:
        return a[0]
    le = a[0:1]
    a = a[1:]
    if minimum(le) < minimum(a):
        return minimum(le)
    else:
        return minimum(a)


def count_letters(s):
    if len(s) == 1:
        return 1
    elif s == '':
        return 0
    return count_letters(s[:1]) + count_letters(s[1:])


def power(x, y):
    if y == 0:
        return 1
    return x * power(x, y - 1)


def factorial(n):
    if int(n) >= 1:
        return 1
    return int(n) * factorial(int(n) - 1)


def factorial(n):
    if int(n) >= 1:
        return 1
    return int(n) * factorial(int(n) + 1)


def factorial(n):
    if int(n) == 1:
        return 1
    return int(n) * factorial(int(n) + 1)


def maximum(a):
    if len(a) == 1:
        return a[0]
    la = a[:1]
    ra = a[1:]
    if maximum(la) < maximum(ra):
        return maximum(ra)
    else:
        return maximum(la)


def reverse_list(a):
    if len(a) == 0:
        return a
    e = a[0]
    a = a[1:]
    b = reverse_list(a) + [e]
    return b

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def factorial(n):
    if int(n) == 1:
        return 1
    return n * factorial(n - 1)


Return the sum of all integers up to n.


def factorial(n):
    if int(n) == 1:
        return 1
    elif int(n) == 0:
        return 1
    return n * factorial(n - 1)


def sumup(n):
    if n == 0:
        return 0
    sum_to_n_minus_1 = sumup(n - 1)
    return n + sum_to_n_minus_

Return the sum of all integers up to n.


def sumup(n):
    if n == 0:
        return 0
    sum_to_n_minus_1 = sumup(n - 1)
    return n + sum_to_n_minus_1

Return the sum of all integers up to n.


def factorial(n):
    if n == 0:
        return 1
    facotrial_n_minus_1 = factorial(n - 1)
    return n * facotrial_n_minus_1


def power(m, n):
    if n == 0:
        return 1
    power_n_minus_1 = power(m, n - 1)
    return m * power_n_minus_1


def count_letters(word):
    if word == '':
        return 0
    return count_letters(word[:-1]) + 1


def count_letters(s):
    if s == '':
        return 0
    else:
        return 1 + count_letters(s[1:])


def power(n, p):
    if p == 0:
        return 1
    else:
        return power(n, p - 1) * n


def minimum(a):
    if len(a) == 1:
        return a[0]
    mini = minimun(a[:-1])
    if a[-1] < mini:
        return a[-1]
    else:
        return mini


def minimum(a):
    if len(a) == 1:
        return a[0]
    mini = minimum(a[:-1])
    if a[-1] < mini:
        return a[-1]
    else:
        return mini


def minimum(nums):
    if len(nums) == 1:
        return nums[0]
    min_num = minimum(nums[:-1])
    if nums[-1] < min_num:
        return nums[-1]
    else:
        return min_num


def maximum(nums):
    if len(nums) == 1:
        return nums[0]
    max_num = maximum(nums[:-1])
    if nums[-1] > max_num:
        return nums[-1]
    else:
        return max_num


def count_letters(string):
    if len(string) == 0:
        return 0
    return 1 + count_letters(string[:-1])


def fibonacci(num):
    if num == 0 or num == 1:
        return 1
    return fibonacci(num - 1) + fibonacci(num - 2)


def reverse_list(nums):
    if len(nums) == 0:
        new_nums = list()
        return new_nums
    new_nums = reverse_list(nums[1:])
    new_nums.append(nums[0])
    return new_nums

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def maximum(a):
    if len(a) == 1:
        return a[0]
    maxi = maximum(a[:-1])
    if a[-1] > maxi:
        return a[-1]
    else:
        return maxi


def minimum(l):
    if len(l) == 1:
        return l[0]
    else:
        min_ret = minimum(l[1:])
        return l[0] if l[0] < min_ret else min_ret


def maximum(l):
    if len(l) == 1:
        return l[0]
    else:
        maxi = minimum(l[1:])
        return l[0] if l[0] > maxi else maxi


def maximum(l):
    if len(l) == 1:
        return l[0]
    else:
        maxi = maximum(l[1:])
        return l[0] if l[0] > maxi else maxi


def count_letters(str):
    total = 0
    for letters in str:
        total += 1
    return total


def count_letters(l):
    if len(l) == 0:
        return 0
    else:
        return 1 + count_letters(l + 1)


def count_letters(l):
    if len(l) == 0:
        return 0
    else:
        return 1 + count_letters(l[1:])


def reverse_list(l):
    if len(a) == 0:
        return []
    else:
        return [a[-1]] + reverse_list(a[:-1])

Recursively reverse a list of elements.


def reverse_list(a):
    if len(a) == 0:
        return []
    else:
        return [a[-1]] + reverse_list(a[:-1])

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return 0
    else:
        return l[-1] + count_letters(l[:-1])

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return 0
    else:
        return l[-1] + reverse_list(l[:-1])

Recursively reverse a list of elements.


def reverse_list(lst):
    return lst[::-1]

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return []
    else:
        return [l[-1]] + reverse_list(l[:-1])

Recursively reverse a list of elements.


def fibonacci(n):
    if n == 0:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def fibonacci(int):
    if int == 0 or int == 1:
        return 1
    return fibonacci(int - 1) + fibonacci(int - 2)


def minimum(l):
    if len(l) == 1:
        return l[0]
    if l[0] <= minimum(l[1:]):
        return l[0]
    else:
        return minimum(l[1:])


def maximum(l):
    if len(l) == 1:
        return l[0]
    if l[0] >= maximum(l[1:]):
        return l[0]
    else:
        return maximum(l[1:])


def reverse_list(a):
    if not a:
        return a
    return [a[-1]] + reverse_list(a[:-1])

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def count_letters(s):
    if len(s) == 0:
        return 0
    return 1 + count_letters(s[:-1])


def reverse_list(l):
    if len(l) == 0:
        rl = list()
        return rl
    rl = reverse_list(l[1:])
    rl.append(l[0])
    return rl

Recursively reverse a list of elements.


def fibonacci(n):
    i = 1
    l = [0, 1]
    while i < n + 1:
        l.append(l[i] + l[i - 1])
        i += 1
    return l[-1]


def count_letters(s):
    if s == '':
        return 0
    return 1 + count_letters(s[1:])


def reverse_list(l):
    if len(l) == 0:
        return []
    return l[-1:] + reverse_list(l[:-1])

Recursively reverse a list of elements.


def fibonacci(N):
    if N == 0 or N == 1:
        return 1
    return fibonacci(N - 1) + fibonacci(N - 2)


def fibonacci(n):
    if n < 2:
        return 1
    return fib(n - 1) + fib(n - 2)


def fibonacci(n):
    if n < 2:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def reverse_list(a):
    if len(a) == 0:
        return []
    return [a[-1]] + reverse_list(a[:-1])

Recursively reverse a list of elements.


def sumup(n):
    if n == 0:
        return 0
    return n + sumup(n - 1)

Return the sum of all integers up to n.


Return the sum of all integers up to n.


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)


def minimum(a):
    if len(a) == 1:
        return a[0]
    h = a[0]
    t = a[1:]
    m = minimum(t)
    if h > m:
        return m
    else:
        return h


def maximum(a):
    if len(a) == 1:
        return a[0]
    h = a[0]
    t = a[1:]
    m = maximum(t)
    if m > h:
        return m
    else:
        return h


def minimum(list):
    smallest = list[0]
    for nr in list:
        if nr < smallest:
            smallest = nr
    return smallest


def sumup(n):
    if n == 0:
        return 0
    else:
        return n + sumup(n - 1)

Return the sum of all integers up to n.


def factorial(n):
    if n == 0:
        return 1
    return n * factorial(n - 1)


def power(m, n):
    if n < 1:
        return 1
    return m * power(m, n - 1)


def fibonacci(n):
    if n <= 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def minimum(li):
    if len(li) == 1:
        return li[0]
    if li[0] < li[-1]:
        li[-1] = li[0]
    return minimum(li[1:])


def maximum(li):
    if len(li) == 1:
        return li[0]
    if li[0] > li[-1]:
        li[-1] = li[0]
    return maximum(li[1:])


def count_letters(s, n=0):
    if len(s) == 0:
        return n
    return count_letters(s[1:], n + 1)


def reverse_list(li, n=0):
    if n == int(len(li) / 2):
        return li
    else:
        li[n], li[-n - 1] = li[-n - 1], li[n]
        return reverse_list(li, n + 1)

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def count_letters(s):
    if s == '':
        return 0
    return 1 + count_letters(s[1:])


def fibonacci(n, older=0, old=1):
    if n == 0:
        return old
    return fibonacci(n - 1, old, older + old)


def maximum(list):
    maximum = list[0]
    for nr in list:
        if nr > maximum:
            maximum = nr
    return maximum


def reverse_list(l):
    if len(l) == 0:
        return []
    return [l[-1]] + reverse_list(l[:-1])

Recursively reverse a list of elements.


def fibonacci(n):
    if n == 1 or n == 0:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def count_letters(s):
    if not s:
        return 0
    return 1 + count_letters(s[1:])


def sumup(n):
    if n == 0:
        return 0
    return n + sumup(n - 1)

Return the sum of all integers up to n.


Return the sum of all integers up to n.


def minimum(l):
    if len(l) == 1:
        return l[0]
    else:
        return minimum(l[1:] if l[0] > l[-1] else l[:-1])


def maximum(l):
    if len(l) == 1:
        return l[0]
    else:
        return maximum(l[1:] if l[0] < l[-1] else l[:-1])


def reverse_list(l):
    if len(l) == 0:
        return l
    return l[-1:] + reverse_list(l[:-1])

Recursively reverse a list of elements.


def fibonacci(n):
    if n == 0:
        return 1
    if n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)


def append2list(l1, l2=None):
    if l2 != None:
        l2 = []
    for i in l1:
        l2.append(i)
    return l2

Appends elements of a list l1 at the end of the list l2. If l2 not supplied default to empty list.


def append2list(l1, l2=None):
    if l2 != None:
        l2 = []
        for i in l1:
            l2.append(i)
        return l2
    else:
        return l1


def append2list(l1, l2=None):
    if l2 == None:
        l2 = []
        for i in l1:
            l2.append(i)
        return l2
    else:
        return l1


def append2list(l1, l2=None):
    if l2 == None:
        l2 = []
    for i in l1:
        l2.append(i)
    return l2


def append2list(l1, l2=None):
    if l2 == None:
        l2 = []
    for i in l2:
        l2.append(i)
    return l2


Test if two circles overlap.


def reverse_list(list):
    if list == []:
        return []
    elif len(list) == 1:
        newlist = []
        newlist.append(list.pop())
    else:
        return reverse_list(list[1:])

Recursively reverse a list of elements.


def reverse_list(list):
    if list == []:
        return []
    else:
        return list(reverse_list(list[1:])).append(list[0])

Recursively reverse a list of elements.


def reverse_list(list):
    if list == []:
        return []
    elif len(list) == 1:
        return [].append(list)
    else:
        return reverse_list(list[1:]).append(list[0])

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def reverse_list(a):
    if a == []:
        return []
    else:
        return a

Recursively reverse a list of elements.


def reverse_list(a):
    if a == []:
        return []
    elif len(a) == 1:
        return a
    else:
        b = [reverse_list(a[1:])]
        return b.append(a[0])

Recursively reverse a list of elements.


def reverse_list(a):
    if a == []:
        return []
    else:
        b = [reverse_list(a[1:])]
        return b.append(a[0])

Recursively reverse a list of elements.


def reverse_list(a):
    if a == []:
        return []
    return [a[-1]] + reverse_list(a[:-1])

Recursively reverse a list of elements.


def count_letters(string):
    if len(string) == 0:
        return 0
    return 1 + count_letters(string[:-1])


def factorial(n):
    if n == 0:
        return 1
    return n * factorial(n - 1)


def fibonacci(num):
    if num == 0 or num == 1:
        return 1
    return fibonacci(num - 1) + fibonacci(num - 2)


def maximum(nums):
    if len(nums) == 1:
        return nums[0]
    max_num = maximum(nums[:-1])
    if nums[-1] > max_num:
        return nums[-1]
    else:
        return max_num


def minimum(nums):
    if len(nums) == 1:
        return nums[0]
    min_num = minimum(nums[:-1])
    if nums[-1] < min_num:
        return nums[-1]
    else:
        return min_num


def power(n, t):
    if t == 0:
        return 1
    t -= 1
    return n * power(n, t)


def reverse_list(nums):
    if len(nums) == 0:
        new_nums = list()
        return new_nums
    new_nums = reverse_list(nums[1:])
    new_nums.append(nums[0])
    return new_nums

Recursively reverse a list of elements.


def sumup(n):
    if n == 0:
        return 0
    return n + sumup(n - 1)

Return the sum of all integers up to n.


Return the sum of all integers up to n.


def count_letters(s='', i=0):
    print((s, i))
    if s == '':
        return i
    i += 1
    return count_letters(s.replace(s[0], '', 1), i)


def factorial(n):
    if n == 0:
        return 1
    if n == 1:
        return n
    return n * factorial(n - 1)


def fibonacci(i, n=1):
    if i == 1 or i == 0:
        return 1
    return fibonacci(i - 1) + fibonacci(i - 2)


def maximum(l, i=0):
    j = i
    while j < len(l) and l[j] > l[-1]:
        j += 1
    if j < len(l):
        tmp = l[i]
        l[i] = l[j]
        l[j] = tmp
    if j > len(l):
        return l[-1]
    return maximum(l, i + 1)


def minimum(l, i=0):
    j = i
    while j < len(l) and l[j] > l[-1]:
        j += 1
    if j < len(l):
        tmp = l[i]
        l[i] = l[j]
        l[j] = tmp
    if j > len(l):
        return l[0]
    return minimum(l, i + 1)


def power(n, m):
    if m == 0:
        return 1
    return n * power(n, m - 1)


def reverse_list(l, i=0):
    if i == len(l) // 2:
        return l
    tmp = l[i]
    l[i] = l[len(l) - 1 - i]
    l[len(l) - 1 - i] = tmp
    i += 1
    return reverse_list(l, i)

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def sumup(n):
    if n == 0:
        return n
    return n + sumup(n - 1)

Return the sum of all integers up to n.


def count_letters(s='', i=0):
    if s == '':
        return i
    i += 1
    return count_letters(s.replace(s[0], '', 1), i)


def sumup(n):
    total = [int(i) for i in range(0, n)]
    return sum(total)

Return the sum of all integers up to n.


def sumup(n):
    total = [int(i) for i in range(0, n + 1)]
    return sum(total)

Return the sum of all integers up to n.


def factorial(n):
    if n == 0:
        return 1
    else:
        total = 1
        for i in range(0, n):
            total *= i
        return factorial(n - 1)


def factorial(n):
    if n == 0:
        return 1
    else:
        total = 1
        for i in range(0, n):
            total *= i
        return factorial(n - 1) * n


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)


def minimum(l):
    if len(l) == 1:
        return l[0]
    large = l[0]
    for num in l:
        if num > large:
            large = num
    return l.remove(large)


def minimum(l):
    if len(l) == 1:
        return l[0]
    large = l[0]
    for num in l:
        if num > large:
            large = num
    return minumum(l.remove(large))


def minimum(l):
    if len(l) == 1:
        return l[0]
    large = l[0]
    for num in l:
        if num > large:
            large = num
    return minimum(l.remove(large))


def minimum(l):
    if len(l) == 1:
        return l[0]
    large = l[0]
    for num in l:
        if num > large:
            large = num
    l.remove(large)
    return minimum(l)


def maximum(l):
    if len(l) == 1:
        return l[0]
    small = l[0]
    for n in l:
        if n < small:
            small = n
    l.remove(small)
    return maximum(l)


def reverse_list(l, new_list=None):
    if new_list == None:
        new_list = []
    if len(l) > 0:
        new_list.append(a.pop())
        return reverse_list(l, new_list)
    else:
        return new_list

Recursively reverse a list of elements.


def reverse_list(l, new_list=None):
    if new_list == None:
        new_list = []
    if len(l) > 0:
        new_list.append(l.pop())
        return reverse_list(l, new_list)
    else:
        return new_list

Recursively reverse a list of elements.


def sumup(n):
    if n == 0:
        return 0
    return n + sumup(n - 1)

Return the sum of all integers up to n.


Return the sum of all integers up to n.


def factorial(n):
    if n == 0:
        return 0
    return n * factorial(n - 1)


def factorial(n):
    if n == 0:
        return 1
    return n * factorial(n - 1)


def power(m, n):
    if n == 0:
        return 1
    return m * (m * power(m, n - 1))


def fibonacci(n):
    if n == 0:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def append2list(l1, l2=None):
    if l2 == None:
        l2 = []
    for i in l1:
        l2.append(i)
    return l2


def swap_unique_keys_values(d):
    return {a[1]: a[0] for a in list(d.items()) if list(d.values()).count(a
        [1]) == 1}


def fibonacci(n):
    if n == 0:
        return 0
    if n == 1:
        return 1
    else:
        fibN_2 = 0
        fibN_1 = 1
        i = 2
        while i <= n:
            fibN = fibN_2 + fibN_1
            fibN_2 = fibN_1
            fibN_1 = fibN
            i = i + 1
        return fibN


def index(str, letter):
    i = 0
    while i < len(str):
        if letter == str[i]:
            return i
        i = i + 1
    return -1


def countdown(num):
    while num >= 1:
        print(num)
        time.sleep(0.1)
        num = num - 1
    print('LIFT OFF!')


def search(str, letter):
    i = 0
    while i < len(str):
        if letter == str[i]:
            return True
        i = i + 1
    return False


def search(str, letter):
    if str == '':
        return False
    elif str[0] == letter:
        return True
    else:
        return search(str[1:], letter)


def index(str, letter, pos):
    if pos == len(str):
        return -1
    elif str[pos] == letter:
        return pos
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def countdown(num):
    import time
    if num == 1:
        print(num)
        time.slep(0.1)
        countdown(num - 1)


def index(str, letter, pos):
    import fibonacci
    if pos == len(str):
        return -1
    elif str[pos] == letter:
        return pos
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def fibonacci(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def search(ls, val):
    if ls == []:
        return False
    elif ls[0] == val:
        return True
    else:
        return search(ls[1:], val)

def index(str, letter):
    if ls == []:
        return -1
    elif ls[0] == val:
        return val
    else:
        return search(ls[1:], val)


def countdown(num):
    if num == 0:
        print('LIFT OFF!')
    else:
        print(num)
        time.sleep(0.1)
        countdown(num - 1)


def search(ls, val):
    if ls == []:
        return False
    elif ls[0] == val:
        return True
    else:
        return search(ls[1:], val)


def search(ls, val):
    if ls == []:
        return
    elif ls[0] == val:
        return True
    else:
        return search(ls[1:], val)


def search(ls, val):
    if ls == []:
        return
    elif ls[0] == val:
        return True
    else:
        return search(ls[1:], val)

def index(str, letter):
    if ls == []:
        return -1
    elif ls[0] == val:
        return val
    else:
        return search(ls[1:], val)


def swap_keys_values(d):
    new_d = {}
    for keys in d:
        new_d[d[keys]] = keys
    return new_d

Swap the keys of a dictionary with its values.


def swap_unique_keys_values(d):
    new_d = {}
    seen = set()
    for key in d:
        seen += d[key]
    for key in d:
        if d[key] in seen:
            new_d[d[key]] = key
    return new_d


def swap_unique_keys_values(d):
    new_d = {}
    seen = []
    for key in d:
        seen.append(d[key])
    for key in d:
        if d[key] in set(seen):
            new_d[d[key]] = key
    return new_d


def swap_unique_keys_values(d):
    new_d = {}
    seen = []
    for key in d:
        seen.append(d[key])
    for key in d:
        if seen.count(d[key]) == 1:
            new_d[d[key]] = key
    return new_d


def search(ls, letter):
    if ls == []:
        return False
    elif ls[0] == val:
        return True
    else:
        return search(ls[1:], val)


def search(ls, letter):
    if ls == []:
        return False
    elif ls[0] == val:
        return True
    else:
        return search(ls[1:], val)

def index(ls, letter):
    if ls == []:
        return -1
    elif ls[0] == val:
        return val
    else:
        return search(ls[1:], val)


def index(str, letter, pos):
    if pos == len(str):
        return -1
    elif str[pos] == letter:
        return pos
    else:
        return index(str, letter, pos + 1)


def search(str, letter):
    if str == []:
        return False
    elif str[0] == val:
        return True
    else:
        return search(str[1:], letter)


def search(str, letter):
    if str == []:
        return False
    elif str[0] == letter:
        return True
    else:
        return search(str[1:], letter)


def search(str, letter):
    if str == '':
        return False
    elif str[0] == letter:
        return True
    else:
        return search(str[1:], letter)


def weird_case(some_str):
    new_str = ''
    i = 0
    lc = 0
    while i < len(some_str):
        if some_str[i].isalpha():
            if lc % 2 == 0:
                new_str += some_str[i].upper()
            else:
                new_str += some_str[i].lower()
            lc += 1
        else:
            new_str += some_str[i]
        i = i + 1
    return new_str


def get_price(age):
    if age <= 16:
        return 5
    elif age <= 60:
        return 10
    else:
        return 7


def merge_lists(l1, l2):
    l3 = []
    i = 0
    while i < len(l1):
        l3.append(l1[i])
        i += 2
    i = 0
    while i < len(l2):
        l3.append(l2[i])
        i += 2
    return l3

Take two lists l1 and l2 and return a third list which contains every second element of l1 and l2.


def remove_zeros(list):
    while 0 in list:
        list.remove(0)

Take a list of numbers and removes the zeros from it.

assert remove_zeros([])==None and remove_zeros([])==None and remove_zeros([5202, -24344, -6528])==None and remove_zeros([5202, -24344, -6528])==None


def swap_unique_keys_values(d):
    b = {}
    return {v: k for k, v in list(d.items())}


def append2list(l1, l2=None):
    if l2 == None:
        l2 = []
    for i in l1:
        l2.append(i)
    return l2


def overlap(x1, y1, r1, x2, y2, r2):
    distance = (x1 - x2) ** 2 + (y0 - y1) ** 2
    radii = r1 + r2
    return distance > radii

Test if two circles overlap.


def overlap(x1=0, y1=0, r1=0, x2=0, y2=0, r2=0):
    distance = (x1 - x2) ** 2 + (y0 - y1) ** 2
    radii = r1 + r2
    return distance > radii

Test if two circles overlap.


def overlap(x1=0, y1=0, r1=0, x2=0, y2=0, r2=0):
    distance = (x1 - x2) ** 2 + (y1 - y2) ** 2
    radii = r1 + r2
    return distance > radii

Test if two circles overlap.


def overlap(x1=0, y1=0, r1=0, x2=0, y2=0, r2=0):
    distance = (x1 - x2) ** 2 + (y1 - y2) ** 2
    radii = r1 + r2
    return distance >= radii

Test if two circles overlap.


def overlap(x1=0, y1=0, r1=0, x2=0, y2=0, r2=0):
    distance = (x1 - x2) ** 2 + (y1 - y2) ** 2
    radii = r1 + r2
    return radii <= distance >= radii

Test if two circles overlap.


Test if two circles overlap.


def overlap(x1=0, y1=0, r1=0, x2=0, y2=0, r2=0):
    distance = sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
    radii = r1 + r2
    return distance >= radii

Test if two circles overlap.


def overlap(x1=0, y1=0, r1=1, x2=0, y2=0, r2=1):
    distance = sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
    radii = r1 + r2
    return distance < radii

Test if two circles overlap.


def sumup(n):
    if n == 0:
        return 0
    return n + sumup(n - 1)

Return the sum of all integers up to n.


Return the sum of all integers up to n.


def factorial(n):
    if n == 0 or n == 1:
        return 1
    return n * factorial(n - 1) + factorial(n - 2)


def factorial(n):
    if n == 0 or n == 1:
        return 1
    return factorial(n - 1) + factorial(n - 2)


def factorial(n):
    if n == 0 or n == 1:
        return 1
    return factorial(n - 1) * factorial(n - 2)


def factorial(n):
    if n == 0:
        return 1
    return factorial(n - 1) * factorial(n - 2)


def factorial(n):
    if n == 1:
        return 1
    return factorial(n - 1) * factorial(n - 2)


def factorial(n):
    if n == 1:
        return 1
    return n * factorial(n - 1)


def factorial(n):
    if n == 1 or n == 0:
        return 1
    return n * factorial(n - 1)


def power(m, n):
    if n == 1:
        return 1
    return m * power(m, n - 1)


def power(m, n):
    if n == 1 or n == 0:
        return 1
    return m * power(m, n - 1)


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)


def minimum(l):
    if len(l) == 1:
        return l[0]
    if l[0] < l[1]:
        l.remove(l[0])
    elif l[0] < l[1]:
        l.remove(l[1])
    return minimum(l)


def minimum(l):
    if len(l) == 1:
        return l[0]
    if l[0] < l[1]:
        l.remove(l[0])
    elif l[1] < l[0]:
        l.remove(l[0])
    return minimum(l)


def minimum(l):
    if len(l) == 1:
        return l[0]
    if l[0] < l[1]:
        l.remove(l[1])
    elif l[1] < l[0]:
        l.remove(l[0])
    return minimum(l)


def maximum(l):
    if len(l) == 1:
        return l[0]
    if l[0] > l[1]:
        l.remove(l[1])
    else:
        l.remove(l[0])
    return maximum(l)


def count_letters(s, l=[]):
    if not s:
        return sum(l)
    l.append(1)
    s = s[1:]
    return count_letters(l, s)


def count_letters(s, l=[]):
    if not s:
        return sum(l)
    l.append(1)
    s = s[1:]
    return count_letters(s, l)


def count_letters(s, l=None):
    if l == None:
        l = []
    if not s:
        return sum(l)
    l.append(1)
    s = s[1:]
    return count_letters(s, l)


def reverse_list(l, new_l=None):
    if new_l == None:
        new_l = []
    if len(l) == 0:
        return new_l
    new_l.append(l.pop())
    return reverse_list(l, new_l)

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    return n * fibonacci(n - 1) + fibonnaci(n - 2)


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    return n * fibonacci(n - 1) + fibonacci(n - 2)


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    return n + fibonacci(n - 1) + fibonacci(n - 2)


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    return n + fibonacci(n - 1)


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    return n * (fibonacci(n - 1) + fibonacci(n - 2))


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    return n + (fibonacci(n - 1) + fibonacci(n - 2))


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def sumup(n):
    if n == 0:
        return 0
    return n + sumup(n - 1)

Return the sum of all integers up to n.


def sumup(n):
    if n == 1:
        return 1
    return n + sumup(n - 1)

Return the sum of all integers up to n.


Return the sum of all integers up to n.


def countdown(num):
    if num == 0:
        print('LIFT OFF!')
    else:
        print(num)
        time.sleep(0.1)
        countdown(num - 1)


def search(str, letter):
    if letter in str:
        print(True)
    else:
        print(False)


def search(str, letter):
    if letter in str:
        return True
    else:
        return False


def countdown(num):
    i = 0
    while i < num:
        print(countdown[num])
        time.sleep(0.1)
        i = i - 1


def countdown(num):
    i = 0
    num = eval(input())
    while i < num:
        print(countdown[num])
        time.sleep(0.1)
        i = i - 1
    print('LIFT OFF!')


def countdown(num):
    i = 0
    num = eval(input())
    while num > 0:
        print(countdown[num])
        time.sleep(0.1)
        i = i - 1
    print('LIFT OFF!')


def countdown(num):
    i = 0
    num = int(input())
    while num > 0:
        print(countdown[num])
        time.sleep(0.1)
        i = i - 1
    print('LIFT OFF!')


def countdown(num):
    i = 0
    num = int(input())
    while i < num:
        print(countdown[num])
        time.sleep(0.1)
        i = i - 1
    print('LIFT OFF!')


def countdown(num):
    i = 0
    num = eval(input())
    while i < countdown[num]:
        print(countdown[num])
        time.sleep(0.1)
        i = i - 1
    print('LIFT OFF!')


def countdown(num):
    i = 0
    while i < num:
        print(countdown[num])
        time.sleep(0.1)
        i = i - 1
    print('LIFT OFF!')


def countdown(num):
    i = 0
    num = eval(input())
    while i < num:
        return countdown[num]
        time.sleep(0.1)
        i = i - 1
    print('LIFT OFF!')


def countdown(x):
    i = 0
    while i < num:
        return countdown[x]
        time.sleep(0.1)
        i = i - 1
    print('LIFT OFF!')


def countdown(x):
    i = 0
    while i < x:
        return countdown[x]
        time.sleep(0.1)
        i = i - 1
    print('LIFT OFF!')


def double(n):
    y = 2 * n
    return y


def area(r):
    y = pi * r ** 2
    return y


def circumference(r):
    y = pi * 2 * r
    return y


def swap(a, i, j):
    tmp = a[j]
    a[j] = a[i]
    a[i] = tmp
    return a

def reverse(a):
    i = 0
    while i < len(a) / 2:
        j = len(a) - i - 1
        swap(a, i, j)
        i = i + 1
    return a

Reverse a list of elements by swapping its elements.


def power(n, m):
    if m == 0:
        return 1
    else:
        return n * power(n, m - 1)


def square_area(n):
    sq = n * n
    return sq


def square_perimeter(n):
    result = 2 * (n + n)
    return result


def circle_circumference(n):
    result = 2 * 3.14 * n
    return result


def circle_area(n):
    result = 3.14 * n ** 2
    return results


def square_area(n):
    result = n * n
    return result


def rectangle_perimeter(n, m):
    result = 2 * (n + m)
    return result


def square_perimeter(n):
    result = 2 * (n + n)
    return sq


def circle_area(n):
    result = 3.14 * n ** 2
    return result


def sumup(n):
    if n == 0:
        return 0
    return n + (n - 1)

Return the sum of all integers up to n.


Return the sum of all integers up to n.


def sumup(n):
    if n == 0:
        return 0
    return sumup(n + (n - 1))

Return the sum of all integers up to n.


def sumup(n):
    if n == 0:
        return 0
    return n + sumup(n - 1)

Return the sum of all integers up to n.


def factorial(n):
    if n == 0:
        return 0
    return n * factorial(n - 1)


def factorial(n):
    if n == 1:
        return 1
    return n * factorial(n - 1)


def factorial(n):
    if n == 1 or n == 0:
        return 1
    return n * factorial(n - 1)


def power(m, n):
    if n == 1 or n == 0:
        return m
    return m + m ** power(n - 1)


def power(m, n):
    if n == 1 or n == 0:
        return m
    return m ** power(n - 1)


def power(m, n):
    if n == 1 or n == 0:
        return m
    elif m == 1:
        return m
    elif m == 0:
        return 0
    return m ** power(n - 1)


def power(m, n):
    if n == 1 or n == 0:
        return m
    elif m == 1:
        return m
    elif m == 0:
        return 0
    return m ** power(m, n - 1)


def power(m, n):
    if n == 1 or n == 0:
        return m
    elif m == 1:
        return m
    elif m == 0:
        return 0
    return m + power(m, n - 1)


def power(m, n):
    if n == 1 or n == 0:
        return m
    elif m == 1:
        return m
    elif m == 0:
        return 0
    return power(m, n) + power(m, n - 1)


def power(m, n):
    if n == 1 or n == 0:
        return m
    elif m == 1:
        return m
    elif m == 0:
        return 0
    return m * power(m, n - 1)


def power(m, n):
    if n == 0:
        return 1
    elif n == 1:
        return m
    elif m == 1:
        return m
    elif m == 0:
        return 0
    return m * power(m, n - 1)


def power(m, n):
    if n == 0:
        return 1
    elif m == 1:
        return m
    elif m == 0:
        return 0
    return m * power(m, n - 1)


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def reverse_list(l):
    if len(l) == 0:
        return []
    return l[-1] + reverse_list(l[:-1])

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return []
    return l[-1] + reverse_list(l[1:])

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return []
    return l[-1].append(reverse_list(l[1:]))

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return []
    return reverse_list(l[-1]).append(l[:-1])

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return l
    return reverse_list(l[-1]).append(l[:-1])

Recursively reverse a list of elements.


def reverse_list(l=[]):
    if len(l) == 0:
        return l
    return reverse_list(l[-1]).append(l[:-1])

Recursively reverse a list of elements.


def reverse_list(l):
    return reverse_list(l[-1]).append(l[:-1])

Recursively reverse a list of elements.


def minimum(l, min):
    if not l:
        return []
    return minimum(l[1:], l[0] if l[0] < val else val)


def minimum(l, min):
    if not l:
        return []
    return minimum(l[1:], l[0] if l[0] < min else min)


def minimum(l):
    min = None
    if not l:
        return []
    return minimum(l[-1] if l[-1] < min else min)


def minimum(l):
    if not l:
        return []
    return minimum(min(l[:-1]))


def minimum(l=[]):
    if not l:
        return []
    return minimum(min(l[:-1]))


def minimum(l):
    if not l:
        return []
    return minimum(min(l))


def factorial(n):
    A = 'fact.c'
    with open(A, 'w') as f:
        f.write(s.format(n))
    with open('stdout.txt', 'w+') as f:
        subprocess.run(['gcc', A, '-o', 'out.o'])
        subprocess.run(['./out.o'], stdout=f)
        f.seek(0)
        return int(f.readline())


Recursively reverse a list of elements.


def reverse_list(l=None):
    if len(l) == 0:
        return l
    return reverse_list(l[-1]).append(l[:-1])

Recursively reverse a list of elements.


def reverse_list(l):
    if l == None:
        return l
    return reverse_list(l[-1]).append(l[:-1])

Recursively reverse a list of elements.


def minimum(l, n):
    if n == 0:
        return l[0]
    min = minimum(l[1:], n - 1)
    if l[0] < min:
        return l[0]
    else:
        return min


def minimum(l, n=0):
    if n == 0:
        return l[0]
    min = minimum(l[1:], n - 1)
    if l[0] < min:
        return l[0]
    else:
        return min


def minimum(l, n=0):
    min = minimum(l[1:], n - 1)
    if l[0] < min:
        return l[0]
    else:
        return min


def minimum(l, n=0):
    if l == None:
        return l
    min = minimum(l[1:], n - 1)
    if l[0] < min:
        return l[0]
    else:
        return min


def minimum(l):
    if len(l) == 0:
        return l[0]
    min = minimum(l[1:])
    if l[0] < min:
        return l[0]
    else:
        return min


def minimum(l):
    if len(l) == 0:
        return l
    min = minimum(l[1:])
    if l[0] < min:
        return l[0]
    else:
        return min


def minimum(l):
    if len(l) == 1:
        return l[0]
    min = minimum(l[1:])
    if l[0] < min:
        return l[0]
    else:
        return min


def maximum(l):
    if len(l) == 1:
        return l[0]
    max = maximum(l[1:])
    if l[0] > max:
        return l[0]
    else:
        return max


def reverse_list(l):
    if len(l) == 1:
        return l[0]
    return reverse_list(l[-1]).append(l[:-1])

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 1:
        return l[0]
    return reverse_list(l[:-1]).append(-1)

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 1:
        return l[0]
    return l[-1] + reverse_list(l[:-1])

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 1:
        return l[0]
    return reverse_list(l[:-1].append(l[-1]))

Recursively reverse a list of elements.


def reverse_list(l):
    if not l:
        return l
    return reverse_list(l[:-1].append(l[-1]))

Recursively reverse a list of elements.


def reverse_list(l):
    if not l:
        return l
    return reverse_list(l[1:].append(l[0]))

Recursively reverse a list of elements.


def reverse_list(l):
    if not l:
        return []
    return reverse_list(l[1:].append(l[0]))

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 1:
        return l[0]
    return reverse_list(l[1:].append(l[0]))

Recursively reverse a list of elements.


def reverse_list(l):
    if not l:
        return l[0]
    return reverse_list(l[1:].append(l[0]))

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def square_area(n):
    sq = n * n
    return sq


def circle_area(n):
    result = 3.14 * n ** 2
    print(result)


def square_perimeter(n):
    result = 2 * (n + n)
    print(result)


def square_area(n):
    result = n * n
    return result


def rectangle_perimeter(n, m):
    result = 2 * (n + m)
    return result


def square_perimeter(n):
    result = 2 * (n + n)
    return result


def circle_area(n):
    result = 3.14 * n ** 2
    return result


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def sort(a):
    i = 0
    while i < len(a):
        p = find_position_of_smallest(a, i)
        swap(a, i, p)
        i = i + 1

Sort a list by repeatedly moving the minimimum of the remaining sublist to the front.

assert sort([0])==None and sort([0])==None and sort([])==None and sort([])==None and sort([' '])==None and sort([' '])==None and sort([70, 339305549])==None and sort([70, 339305549])==None


def reverse(a):
    a = a[::-1]
    return a


def circumference(r):
    return 2 * (3.141 * r)


def circumference(r):
    return 2 * (pi * r)


def circumference(r):
    return 2 * pi * r


def circumference(r):
    return 2 * 3.141 * r


def reverse(a):
    i = 0
    while i < len(a) / 2:
        a[len(a) - i - 1], a[i] = a[i], a[len(a) - i - 1]
        i += 1
    return a


def swap(a, i, j):
    a[i], a[j] = a[j], a[i]
    return a

def find_smallest_position(a, i):
    p = i
    j += 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j += 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, j)
        i += 1
    return a

Sort a list by repeatedly move minimimum of remaining sublist to front.


def swap(a, i, j):
    a[i], a[j] = a[j], a[i]
    return a

def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j += 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, j)
        i += 1
    return a


def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j += 1
    return p

def swap(a, i, j):
    a[i], a[j] = a[j], a[i]
    return a

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, j)
        i += 1
    return a


def selection_sort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j += 1
        a[i], a[j] = a[j], a[i]
        i += 1
    return a


def selection_sort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j += 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i += 1
    return a


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low

Search for element q in the sorted array a.