def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

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


Sort a list by recursively partitionioning list until sorted.


def minimum(a, minimum=0):
    if not a:
        return minimum
    test = a.pop()
    if test < minimum or minimum == 0:
        return minimum(a, test)
    return minimum(a, minimum)

Return the minimum element in a list of numbers.


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

Raise m to the power of n.


Raise m to the power of n.


def minimum(a, minimum=0):
    if not a:
        return minimum
    test = int(a.pop())
    if test < minimum or minimum == 0:
        return minimum(a, test)
    return minimum(a, minimum)


def minimum(a, minimum=0):
    if not a:
        return minimum
    test = str(a.pop())
    if int(test) < int(minimum) or int(minimum) == 0:
        return minimum(a, int(test))
    return minimum(a, int(minimum))


def minimum(a, minimum=0):
    if not a:
        return minimum
    test = str(a.pop())
    if int(test) < int(minimum) or int(minimum) == 0:
        return minimum(a, test)
    return minimum(a, minimum)


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

assert selectionsort([])==None and selectionsort([])==None and selectionsort([0])==None and selectionsort([0])==None

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


def minimum(a, mini=0):
    if not a:
        return mini
    test = a.pop()
    if test < mini or mini == 0:
        return minimum(a, test)
    return minimum(a, mini)


def maximum(a, high=0):
    if not a:
        return high
    test = a.pop()
    if test > high or high == 0:
        return maximum(a, test)
    return maximum(a, high)

Return the maximum element in a list of numbers.


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


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


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


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

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

Return the number of lettres in a string.


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


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

Recursively reverse a list of elements.


Recursively reverse a list of elements.


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

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

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


def quicksort(l, beg, fin):
    if fin - beg < 1:
        return
    i = j = beg
    while i <= fin:
        if l[i] <= l[fin]:
            l[i], l[j] = l[j], l[i]
            j += 1
        i += 1
    quicksort(l, beg, j - 2)
    quicksort(l, j, fin)


def quicksort(a, start, end):
    if end - start < 1:
        return
    i = k = start
    while i <= end:
        if a[i] <= a[end]:
            a[i], a[k] = a[k], a[i]
            k = k + 1
        i = i + 1


def quicksort(a, start, end):
    if end - start < 1:
        return
    i = k = start
    while i <= end:
        if a[i] <= a[end]:
            a[i], a[k] = a[k], a[i]
            k = k + 1
        i = i + 1
    quicksort(a, start, k - 2)
    quicksort(a, j, end)


def quicksort(a, start, end):
    if end - start < 1:
        return
    i = k = start
    while i <= end:
        if a[i] <= a[end]:
            a[i], a[k] = a[k], a[i]
            k = k + 1
        i = i + 1
    quicksort(a, start, k - 2)
    quicksort(a, k, end)


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


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


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

Recursively reverse a list of elements.


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q = q + 1
        j = j + 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):

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


def selectionsort(A):
    for h in range(len(A)):
        min_i = h
        for i in range(h, len(A)):
            if A[i] < A[min_i]:
                min_i = i
        A[h], A[min_i] = A[min_i], A[h]


def selectionsort(A):
    i = 0
    while i < len(A):
        p = i
        j = i + 1
        while j < len(A):
            if A[j] < A[i]:
                p = j
            j = j + 1
        tmp = A[p]
        A[p] = A[i]
        A[i] = tmp
        i = i + 1


def selectionsort(A):
    i = 0
    while i < len(A):
        p = i
        j = i + 1
        while j < len(A):
            if A[j] > A[i]:
                p = j
            j = j + 1
        tmp = A[p]
        A[p] = A[i]
        A[i] = tmp
        i = i + 1


def selectionsort(A):
    for h in range(len(A)):
        mini = h
        for i in range(h, len(A)):
            if A[i] < A[mini]:
                mini = i
        A[h], A[mini] = A[mini], A[h]


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


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


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


def parition(a, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]

def quicksort(a, p, r):
    if r <= p:
        return
    else:
        q = parition(a, p, r)
        quicksort(a, p, q - 1)
        quicksort(a, q + 1, r)


def parition(a, p, r):
    q = j = p
    while j < r:
        if a[j] <= a[r]:
            a[q], a[j] = a[j], a[q]
            q += 1
        j += 1
    a[q], a[r] = a[r], a[q]

def quicksort(a, p, r):
    if r <= p:
        return
    else:
        q = parition(a, p, r)
        quicksort(a, p, q - 1)
        quicksort(a, q + 1, r)


def parition(a, p, r):
    q = j = p
    while j < r:
        if a[j] <= a[r]:
            a[q], a[j] = a[j], a[q]
            q += 1
        j += 1
    a[q], a[r] = a[r], a[q]
    return q

def quicksort(a, p, r):
    if r <= p:
        return
    else:
        q = parition(a, p, r)
        quicksort(a, p, q - 1)
        quicksort(a, q + 1, r)


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):

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


def index(str, letter, pos):
    if pos == len(str):
        return -1
    elif str[pos] == letter:
        return pos
    else:
        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[i] == '':
        return False
    elif str[0] == letter:
        return True
    else:
        search(str[1:], letter)

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

Recursively search for a letter in a string


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


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


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


def fibonacci(n):
    if n == 1 or n == 0:
        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.


Recursively reverse a list of elements.


def selectionsort(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


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

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 quicksort(A, p, r):
    if r <= p:
        return
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


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


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 quicksort(A, beg, end):
    if end - beg < 1:
        return
    i = j = beg
    while i <= end:
        if A[i] <= A[end]:
            A[i], A[j] = A[j], A[i]
            j += 1
        i += 1
    quicksort(A, beg, j - 2)
    quicksort(A, j, end)


def selectionsort(A):
    for i in range(len(A)):
        min_j = i
        for j in range(i, len(A)):
            if A[j] < A[min_j]:
                min_j = j
        A[i], A[min_j] = A[min_j], A[i]


def swap_first_last(a, first, last):
    if first >= last:
        return
    a[first], a[last] = a[last], a[first]
    first += 1
    last -= 1
    swap_first_last(a, first, last)

def reverse_list(a):
    swap_first_last(a, 0, len(a) - 1)
    return a

Recursively reverse a list of elements.


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


def partition(a, p, r):
    q = j = p
    while j < r:
        if a[j] <= a[r]:
            a[q], a[j] = a[j], a[q]
            q += 1
        j += 1
    a[q], a[r] = a[r], a[q]
    return q

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 quicksort(A, start, end):
    if end - start < 1:
        return
    i = j = start
    while i <= end:
        if A[i] <= A[end]:
            A[i], A[j] = A[j], A[i]
            j += 1
        i += 1
    quicksort(A, start, j - 2)
    quicksort(A, j, end)


def power(a, b):
    if b == 0:
        return 1
    return a * power(a, b - 1)

Raise m to the power of n.


Raise m to the power of n.


def minimum(a):
    i = 1
    s = a[0]
    while i < len(a):
        if s > a[i]:
            s = a[i]
        i = i + 1
    return s


def maximum(a):
    a = sorted(a)
    return a[len(a) - 1]


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


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

Raise m to the power of n.


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

Raise m to the power of n.


def power(n, mult):
    return n ** mult
    power(n, mult - 1)

Raise m to the power of n.


def reverse_list(a):
    b = []
    i = 0
    while i < len(a):
        b.append(a.pop())
    i = i + 1
    return b

Recursively reverse a list of elements.


Recursively reverse a list of elements.


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

Raise m to the power of n.


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


def minimum(l):
    if len(l) == 1:
        return l[0]
    if l[0] < l[1]:
        l.remove(l[1])
    else:
        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 fibonacci(n):
    if n == 0:
        return 1
    elif n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def selectionsort(A):
    for i in range(len(A)):
        min_j = i
        for j in range(i, len(A)):
            if A[j] < A[min_j]:
                min_j = j
        A[i], A[min_j] = A[min_j], A[i]


def minimum(lis, p=0):
    if lis == []:
        return p
    n = pop(lis)
    if n > p:
        p = n
    return minimum(lis)


def minimum(lis, p=0):
    if lis == []:
        return p
    n = lis.pop()
    if n > p:
        p = n
    return minimum(lis)


def minimum(lis, p=0):
    if lis == []:
        return p
    n = lis.pop()
    if n > p:
        p = n
    return minimum(lis, p)


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 maximum(lis, p=0):
    if lis == []:
        return p
    n = lis.pop()
    if n > p:
        p = n
    return minimum(lis, p)


def maximum(lis, p=0):
    if lis == []:
        return p
    n = lis.pop()
    if n > p:
        p = n
    return maximum(lis, p)


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


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


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

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 selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        a[i], a[p] = a[p], a[i]
        i = i + 1


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


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

Recursively reverse a list of elements.


Recursively reverse a list of elements.


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


def power(base, exp):
    if exp == 0:
        return 1
    elif exp == 1:
        return base
    else:
        base *= base
        new_exp = exp - 1
        power(base, exp)

Raise m to the power of n.


def power(base, exp):
    if exp == 0:
        return 1
    elif exp == 1:
        return base
    else:
        base *= base
        new_exp = exp - 1
        power(base, new_exp)

Raise m to the power of n.


def power(base, exp):
    if exp == 0:
        return 1
    elif exp == 1:
        return base
    else:
        base *= base
        new_exp = exp - 1
        return power(base, new_exp)

Raise m to the power of n.


def power(base, exp):
    if exp == 0:
        return 1
    elif exp == 1:
        return base
    else:
        new_base = base * base
        new_exp = exp - 1
        return power(new_base, new_exp)

Raise m to the power of n.


def power(base, exp, mult=None):
    if mult is None:
        mult = base
    if exp == 0:
        return 1
    elif exp == 1:
        return base
    else:
        new_base = base * mult
        new_exp = exp - 1
        return power(new_base, new_exp, mult)

Raise m to the power of n.


Raise m to the power of n.


def minimum(l):
    min = inf
    for item in l:
        min = item if item < min else min
    return min


def minimum(l):
    min = None
    for item in l:
        min = item if min == None or item < min else min
    return min


def maximum(l):
    min = None
    for item in l:
        min = item if min == None or item > min else min
    return min


def maximum(l):
    max = None
    for item in l:
        max = item if max == None or item > max else max
    return max


def maximum(l, old_max=None):
    item = l[0]
    if item != None:
        new_l = l[1:]
        maximum(new_l, item if old_max == None or item > old_max else old_max)
    else:
        return old_max


_A = None

def maximum(l, old_max=_A):
    try:
        item = l[0]
    except IndexError:
        item = _A
    if item is not _A:
        new_l = l[1:]
        maximum(new_l, item if old_max == _A or item > old_max else old_max)
    else:
        return old_max


_A = None

def maximum(l, old_max=_A):
    try:
        item = l[0]
    except IndexError:
        item = _A
    if item is not _A:
        new_l = l[1:]
        return maximum(new_l, item if old_max == _A or item > old_max else
            old_max)
    else:
        return old_max


_A = None

def minimum(l, old_min=_A):
    try:
        item = l[0]
    except IndexError:
        item = _A
    if item is not _A:
        new_l = l[1:]
        return minimum(new_l, item if old_min == _A or item < old_min else
            old_min)
    else:
        return old_min


def count_letters(item, length=0):
    try:
        item[0]
    except IndexError:
        return length
    item = item[1:]
    length += 1
    return count_letters(item, length)


def reverse_list(l, new_l=None):
    if new_l is None:
        new_l = []
    if len(l) > 0:
        i = l[0]
        l = l[1:]
        new_l = [i] + new_l
        return reverse_list(l, new_l)
    else:
        return new_l

Recursively reverse a list of elements.


Recursively reverse a list of elements.


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


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


def quicksort(A, start, end):
    if end - start < 1:
        return
    i = j = start
    while i <= end:
        if A[i] <= A[end]:
            A[i], A[j] = A[j], A[i]
            j += 1
        i += 1
    quicksort(A, start, j - 2)
    quicksort(A, j, end)


def selectionsort(A):
    for i in range(len(A)):
        min_j = i
        for j in range(i, len(A)):
            if A[j] < A[min_j]:
                min_j = j
        A[i], A[min_j] = A[min_j], A[i]


def fibonacci(s):
    if s == 0:
        return 1
    else:
        return fibonacci(s - 1) + fibonacci(s + 5)


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


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


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

Raise m to the power of n.


Raise m to the power of 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 reverse_list(l):
    if len(l) == 0:
        return []
    else:
        return [l[-1]] + reverse_list(l[:-1])

Recursively reverse a list of elements.


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

Recursively reverse a list of elements.


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

Raise m to the power of n.


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


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


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


def maximum(l):
    return sorted(l)[len(l) - 1]


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


def count_letters(s):
    length = 0
    for i in s:
        length += 1
    return length


def reverse_list(l):
    new_l = []
    sortedl = [i for i in sorted[l]]
    for i in range(len(l)):
        new_l += sortedl[len(l) - i - 1]

Recursively reverse a list of elements.


def selectionsort(a):
    i = 0
    while i < len(a):
        j = 0
        while j < len(a):
            if a[j] > a[i]:
                a[i], a[j] = a[j], a[i]
            j += 1
        i += 1


def reverse_list(l):
    new_l = []
    sortedl = [i for i in sorted[l]]
    for i in range(len(l)):
        new_l += sortedl[len(l) - i - 1]
    return new_l

Recursively reverse a list of elements.


def reverse_list(l):
    new_l = []
    sortedl = [i for i in sorted(l)]
    for i in range(len(l)):
        new_l += sortedl[len(l) - i - 1]
    return new_l

Recursively reverse a list of elements.


def reverse_list(l):
    new_l = []
    sortedl = [i for i in sorted(l)]
    for i in range(len(l)):
        new_l.append(sortedl[len(l) - i - 1])
    return new_l

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return []
    else:
        new_l = []
        sortedl = [i for i in sorted(l)]
        for i in range(len(l)):
            new_l.append(sortedl[len(l) - i - 1])
        return new_l

Recursively reverse a list of elements.


Recursively reverse a list of elements.


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


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


def fibonacci(n):
    if n == 1 or n == 0:
        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 selectionsort(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


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


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

Raise m to the power of n.


Raise m to the power of n.


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

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 maximum(a):
    if len(a) == 1:
        return a[0]
    if a[0] > a[1]:
        a.remove(a[1])
        return maximum(a)
    else:
        a.remove(a[0])
        return maximum(a)


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


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


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:
        return 1
    elif n == 2:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


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


def fibonacci(n):
    if n == 0:
        return 1
    elif n == 1:
        return 1
    elif n >= 2:
        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 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 minimum(a):
    if len(a) == 1:
        return a
    b = max(a)
    a.replace(b, '')
    return minimum(a)


def minimum(a):
    if len(a) == 1:
        return a
    b = max(a)
    a = [c for c in a if c != b]
    return minimum(a)


def minimum(a):
    if len(a) == 1:
        return a[0]
    b = max(a)
    a = [c for c in a if c != b]
    return minimum(a)


def maximum(a):
    if len(a) == 1:
        return a[0]
    b = min(a)
    a = [c for c in a if c != b]
    return maximum(a)


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


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


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


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


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


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


def count_letters(s):
    total = 0
    if s == '':
        return total
    for t in s:
        total += 1
    s = ''
    return count_letters(s)


def count_letters(s):
    total = 0
    if s == '':
        return total
    for t in s:
        total += 1
    print(total)
    s = ''
    return count_letters(s)


def count_letters(s):
    if s == '':
        return total
    for t in s:
        total = 0
        total += 1
    print(total)
    s = ''
    return count_letters(s)


def count_letters(s):
    for t in s:
        total = 0
        total += 1
    if s == '':
        return total
    s = ''
    return count_letters(s)


def count_letters(s):
    try:
        if s == '':
            return b
    except IndexError:
        return 0
    b = s.index(s[-1])
    s = ''
    return count_letters(s)


def count_letters(s):
    b = s.index(s[-1])
    s = ''
    try:
        if s == '':
            return b
    except IndexError:
        return 0
    return count_letters(s)


def count_letters(s):
    b = s.index(s[-1]) + 1
    s = ''
    try:
        if s == '':
            return b
    except IndexError:
        return 0
    return count_letters(s)


def count_letters(s):
    try:
        b = s.index(s[-1]) + 1
    except IndexError:
        return 0
    s = ''
    if s == '':
        return b
    return count_letters(s)


Raise m to the power of n.


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


def count_letters(s):
    n = 0
    print(s)
    if not s:
        return 0
    else:
        n += 1
        return n + count_letters(s[1:])


def minimum(l):
    biggest = l[0]
    for c in l:
        if c < biggest:
            biggest = c
    return biggest


def maximum(l):
    biggest = l[0]
    for c in l:
        if c > biggest:
            biggest = c
    return biggest


def count_letters(s):
    n = 0
    print(n)
    if not s:
        return 0
    else:
        n += 1
        return n + count_letters(s[1:])


def count_letters(s):
    n = 0
    print(n)
    if not s:
        return 0
    else:
        n += 1
        print(n)
        return n + count_letters(s[1:])


def count_letters(s):
    counter = 0
    if s == '':
        return 0
    else:
        for c in s:
            counter += 1
    return counter


def reverse_list(l):
    l2 = []
    i = 0
    while l:
        l2.append(l[len(l) - i - 1])
        tmp = l.pop()
    return l2

Recursively reverse a list of elements.


Recursively reverse a list of elements.


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


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

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 selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j += j
        a[p], a[i] = a[i], a[p]
        i += 1


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


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

Raise m to the power of n.


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

Raise m to the power of n.


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

Raise m to the power of n.


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

Raise m to the power of n.


Raise m to the power of n.


def minimum(l, m=None):
    if not len(l):
        return m
    if not m or l[0] < m:
        return minimum(l[1:], l[0])
    return minimum(l[1:], m)


def selectionsort(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


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

Recursively reverse a list of elements.


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


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


def reverse_list(l, r=None):
    if not r:
        r = []
    if not l:
        return r
    r.append(l.pop())
    return reverse_list(l, r)

Recursively reverse a list of elements.


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


def fibonacci(n, l=0, c=1):
    if not n:
        return c
    return fibonacci(n - 1, c, l + c)


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


def fibonacci(n):
    if n == (0 or 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 reverse_list(l, ding=None):
    if not ding:
        ding = []
    if not l:
        return ding
    ding.append(l.pop())
    return reverse_list(l, ding)

Recursively reverse a list of elements.


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


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

Raise m to the power of n.


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


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


Recursively reverse a list of elements.


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

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 quicksort(l):
    if len(l) < 2:
        return l
    pivot = l[0]
    left = []
    right = []
    for n in l[1:]:
        if n < pivot:
            left.append(n)
        else:
            right.append(n)
    return quicksort(left) + [pivot] + quicksort(right)


def fibonacci(aaliyah, supercalifragilisticespialidotious=0, koppaberg=1):
    if not aaliyah:
        return koppaberg
    return fibonacci(aaliyah - 1, koppaberg,
        supercalifragilisticespialidotious + koppaberg)


def quicksort(cabbages):
    if len(l) < 2:
        return l
    pivot = l[0]
    left_side = []
    right_side = []
    for n in cabbages[1:]:
        if n < pivot:
            left_side.append(n)
        else:
            right_side.append(n)
    return quicksort(left_side) + [pivot] + quicksort(right_side)


def quicksort(l, first, last):
    if first >= last:
        return
    i, j = first, last
    pivot = l[random.randint(first, last)]
    while i <= j:
        while l[i] < pivot:
            i += 1
        while l[j] > pivot:
            j -= 1
        if i <= j:
            l[i], l[j] = l[j], l[i]
            i, j = i + 1, j - 1
    quicksort(l, first, j)
    quicksort(l, i, last)
    return l


def quicksort(l, start=0, end=None):
    if len(l) < 2:
        return l
    pivot = l[0]
    left = []
    right = []
    for n in l[1:]:
        if n < pivot:
            left.append(n)
        else:
            right.append(n)
    return quicksort(left) + [pivot] + quicksort(right)


def quicksort(l, start=0, end=None):
    if len(l) < 2:
        return l
    pivot = l[1]
    left = []
    right = []
    for n in l[1:]:
        if n < pivot:
            left.append(n)
        else:
            right.append(n)
    return quicksort(left) + [pivot] + quicksort(right)


def quicksort(l, p, r):
    if r <= p:
        return
    q = j = p
    while j < r:
        if l[j] <= l[r]:
            l[q], l[j] = l[j], l[q]
            q += 1
        j += 1
    l[q], l[r] = l[r], l[q]
    quicksort(l, p, q - 1)
    quicksort(l, q + 1, r)


def selectionsort(l, o=None):
    if not o:
        o = []
        l = l[:]
    if not len(l):
        return o
    small = min(l)
    l.remove(small)
    o.append(small)
    return selectionsort(l, o)


def selectionsort(l):
    for i in range(len(l)):
        j = i + 1
        p = i
        while j < len(l):
            if l[j] < l[p]:
                p = j
            j += 1
        l[p], l[i] = l[i], l[p]


def selectionsort(a):
    for i in range(len(a)):
        j = i + 1
        p = i
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j += 1
        a[p], a[i] = a[i], a[p]


def fibonacci(n, last=0, curr=1):
    if not n:
        return curr
    return fibonacci(n - 1, curr, last + curr)


def reverse_list(a, reverse=None):
    if not reverse:
        reverse = []
    if len(a) < 1:
        return reverse
    reverse.append(a.pop())
    return reverse_list(a, reverse)

Recursively reverse a list of elements.


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


def maximum(l, max_n=None):
    if not len(l):
        return max_n
    if not max_n or l[0] > max_n:
        return maximum(l[1:], l[0])
    return maximum(l[1:], max_n)


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


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(list):
    if len(list) == 1:
        return list[0]
    else:
        m = maximum(list[1:])
        return m if m > list[0] else list[0]


def minimum(list):
    if len(list) == 1:
        return list[0]
    else:
        return min(list[0], minimum(list[1:]))


def count_letters(str):
    return len(str)


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 quicksort(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q


def selectionsort(alist):
    for fillslot in range(len(alist) - 1, 0, -1):
        positionOfMax = 0
        for location in range(1, fillslot + 1):
            if alist[location] > alist[positionOfMax]:
                positionOfMax = location
        temp = alist[fillslot]
        alist[fillslot] = alist[positionOfMax]
        alist[positionOfMax] = temp


def quicksort(l, p, r):
    if r <= p:
        return
    q = j = p
    while j < r:
        if l[j] <= l[r]:
            l[q], l[j] = l[j], l[q]
            q += 1
        j += 1
    l[q], l[r] = l[r], l[q]
    quicksort(l, p, q - 1)
    quicksort(l, q + 1, r)


def minimum(lst):
    if len(lst) == 1:
        return lst[-1]
    elif lst[0] < lst[-1]:
        return minimum(lst[:-1])
    elif lst[0] > lst[-1]:
        return minimum(lst[1:])


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

Raise m to the power of n.


Raise m to the power of n.


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

Raise m to the power of n.


def index(word, letter):
    i = 0
    while i < len(word):
        if letter not in word:
            return -1
        elif word[i] == letter:
            return i
        else:
            i = i + 1

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


def fibonacci(n):
    a = 0
    b = 1
    for i in range(0, n):
        print(a)
        temp = a
        a = b
        b = temp + b
    return a

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


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

Iteratively search for a letter in a string


def fibonacci(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        a = 0
        b = 1
        i = 2
        while i <= n:
            fib = a + b
            a = b
            b = fib
            i += 1
        return fib


assert double(0)==0 and double(-7601)==-15202

Double a number or a string.


Double a number or a string.


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

assert circumference(0)==0.0 and circumference(-23091)==-145057.662

Return the circumference of a circle.


Return the area of a circle with the given coordinates.


Return the circumference of a circle.


Reverse a list of elements by swapping its elements.


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

def reverse(a):
    return swap(a)


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


def selection_sort(a):
    for i in range(len(a)):
        j = 1
        if a[j] > a[i]:
            tmp = a[i]
            a[i] = a[j]
            a[j] = tmp
        j += 1
    return a


def selection_sort(a):
    return sorted(a)


def swap_unique_keys_values(d):
    return dict([(v, k) for k, v in list(d.items()) if list(d.values()).
        count(v) == 1])

Swap the keys of a dictionary with its unique values.


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 index(str, letter, pos + 1)


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
    else:
        return m * power(m, n)

Raise m to the power of n.


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

Raise m to the power of n.


Raise m to the power of n.


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

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(list):
    if len(list) == 1:
        return list[0]
    else:
        if list[-1] < list[0]:
            list.remove[-1]
        else:
            list.remove[0]
        return minmum(list)


def minimum(list):
    if len(list) == 1:
        return list[0]
    else:
        if list[-1] < list[0]:
            list.pop(0)
        else:
            list.pop(-1)
        return minimum(list)


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


def count_letters(string):
    if not string:
        return 0
    else:
        return 1 + count_letters(string.replace(string[0], ''))


def count_letters(string):
    if not string:
        return 0
    else:
        return 1 + count(string.replace(string[0], ''))


def count_letters(string):
    if not string:
        return 0
    else:
        return 1 + count_letters(string.replace(string[0], '', 1))


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

Recursively reverse a list of elements.


def reverse_list(listt):
    if not listt:
        return listt
    else:
        return list(listt[-1]) + reverse_list(listt[:-1])

Recursively reverse a list of elements.


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

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def selection_sort(a):
    for i in range(len(a)):
        least = i
        for k in range(i + 1, len(a)):
            if a[k] < a[least]:
                least = k
        tmp = a[i]
        a[i] = a[k]
        a[k] = tmp


def selection_sort(a):
    for i in range(len(a)):
        mini = min(a[i:])
        min_index = a[i:].index(mini)
        a[i + min_index] = a[i]
        a[i] = mini
        return a


def selection_sort(a):
    for i in range(len(a)):
        mini = min(a[i:])
        min_index = a[i:].index(mini)
        a[i + min_index] = a[i]
        a[i] = mini
    return a


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


def rectangle_perimeter(x, y):
    return 2 * x + 2 * y

Return the perimeter of a rectangle with the given coordinates.


def square_perimeter(x):
    return x * 4

assert square_perimeter(0)==0 and square_perimeter(-12684)==-50736

Returns the perimeter of a square.


def circle_circumference(r):
    return 2 * 3.14 * r

assert circle_circumference(0)==0.0 and circle_circumference(25619)==160887.32

Return the circumference of a circle.


def circle_area(r):
    return r * r * 3.141

Return the area of a circle.


def square_area(x, y):
    area = x * y
    if 0 <= area:
        return area
    else:
        return -area

assert square_area(0)==0 and square_area(21138)==446815044

Return the area of a square.


Return the area of a circle.


Returns the perimeter of a square.


Return the circumference of a circle.


def square_area(x):
    area = x * x
    return area

Return the area of a square.


def circle_area(r):
    return r * r * 3.14

Return the area of a circle.


Return the area of a square.


Iteratively reverse a list of elements.


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

Double a number or a string.


Double a number or a string.


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


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

Return the circumference of a circle.


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

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


def append2list(l1, 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=[]):
    l2 = l1
    return l2


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


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


def append2list(l1, l2=None):
    for i in l1:
        try:
            l2.append(i)
        except AttributeError:
            continue
    return l2


def append2list(l1, l2):
    for i in l1:
        try:
            l2.append(i)
        except AttributeError:
            continue
    return l2


def append2list(l1, l2=''):
    for i in l1:
        try:
            l2.append(i)
        except AttributeError:
            continue
    return l2


def append2list(l1, l2=[]):
    for i in l1:
        try:
            l2.append(i)
        except AttributeError:
            continue
    return l2


def append2list(l1, l2=[]):
    for i in l1:
        try:
            l1 = []
            l2.append(i)
        except AttributeError:
            continue
    return l2


def append2list(l1, l2=[]):
    for i in l1:
        try:
            l1 = []
            l2 = []
            l2.append(i)
        except AttributeError:
            continue
    return l2


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


def swap_keys_values(d):
    dictionary = {}
    for k, v in list(d.items()):
        dictionary[v] = k
    return dictionary

Swap the keys of a dictionary with its values.


def swap_unique_keys_values(d):
    dictionary = {}
    unique = set(d.values())
    for k, v in list(d.items()):
        if v in unique:
            dictionary[v] = k
    return dictionary


def swap_unique_keys_values(d):
    dictionary = {}
    unique = []
    for k, v in list(d.items()):
        unique.append((k, v))
    print(unique)


def swap_unique_keys_values(d):
    dictionary = {}
    unique = []
    for k, v in list(d.items()):
        unique.append((k, v))
    for k, v in unique:
        if unique.count(v) > 1:
            del unique[k, v]
    print(unique)


def swap_unique_keys_values(d):
    dictionary = {}
    unique = []
    for k, v in list(d.items()):
        unique.append((k, v))
    for k, v in unique:
        print(v)


def swap_unique_keys_values(d):
    dictionary = {}
    unique = []
    for k, v in list(d.items()):
        unique.append((k, v))
    for k, v in unique:
        if unique.count(v) > 1:
            print(v)


def swap_unique_keys_values(d):
    dictionary = {}
    unique = []
    deli = []
    for k, v in list(d.items()):
        unique.append(v)
    for v in unique:
        if unique.count(v) > 1:
            deli.append(v)
    for v in unique:
        if v in deli:
            del unique[v]
    for k, v in list(d.items()):
        if v in unique:
            dictionary[v] = k
    return dictionary


def swap_unique_keys_values(d):
    dictionary = {}
    unique = []
    deli = []
    for k, v in list(d.items()):
        unique.append(v)
    for v in unique:
        if unique.count(v) > 1:
            deli.append(v)
    for v in unique:
        try:
            if v in deli:
                del unique[v]
        except:
            continue
    for k, v in list(d.items()):
        if v in unique:
            dictionary[v] = k
    return dictionary


def swap_unique_keys_values(d):
    dictionary = {}
    counter = []
    new = []
    for k, v in list(d.items()):
        counter.append(v)
    for c in counter:
        if counter.count(c) == 1:
            new.append(c)
    for k, v in list(d.items()):
        if v in new:
            dictionary[v] = k
    return dictionary


Double a number or a string.


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

Return the circumference of a circle.


Return the circumference of a circle.


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.


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 = j + 1
        tmp = a[i]
        a[i] = a[p]
        a[p] = tmp
        i = i + 1
    return a


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

def reverse(a):
    return swap(a)


def reverse(a):
    return [i for i in range(len(a), 0, -1)]


def reverse(a):
    new = []
    for i in a.__reversed__():
        new.append(i)
    return new


def swap(a, i='', j=''):
    if i == '' and j == '':
        i = 0
        j = len(a) - 1
        k = 0
        while k < len(a) / 2:
            a[i], a[j] = a[j], a[i]
            i += 1
            j -= 1
            k += 1
    else:
        a[i], a[j] = a[j], a[i]
    return a

def reverse(a):
    return swap(a)


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

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


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


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

Return the circumference of a circle.


def area(radius):
    return pi * radius ** 2


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


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

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

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

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

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


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

Return the area of a square.


Return the area of a square.


def circle_area(n):
    ca = 2 * 3.14 * n
    return cc

Return the area of a circle.


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

Return the area of a square.


def rectangle_perimeter(n, a):
    rp = n + n + a + a
    return rp


def square_perimeter(n):
    sa = n * 4
    return sp

Returns the perimeter of a square.


def square_perimeter(n):
    sp = n * 4
    return sp

Returns the perimeter of a square.


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

Return the area of a circle.


Returns the perimeter of a square.


def circle_area(n):
    ca = 3.14 * (n * n)
    return ca

Return the area of a circle.


Return the area of a circle.


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

Return the circumference of a circle.


Return the circumference of a circle.


def square_area(n):
    sa = n + n
    return sa

Return the area of a square.


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

Return the circumference of a circle.


def circle_area(radius):
    result = 3.14 * (radius * radius)
    return result

Return the area of a circle.


def rectangle_perimeter(length, height):
    result = 2 * length + 2 * height
    return result


def square_perimeter(side):
    result = side * 4
    return result

Returns the perimeter of a square.


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

Return the area of a square.


Return the area of a square.


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


def sort(a):
    i = 0
    p = 0
    while i < len(a):
        if a[i] > a[p]:
            tmp = a[i]
            a[i] = a[p]
            a[p] = tmp
        i = i + 1


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


def 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 = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def 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 = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
    i = i + 1
    i = i + 1


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

def sort(a):
    find_position_of_smallest(a, i)
    a[0] = tmp


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

def sort(a):
    find_position_of_smallest(a, i)
    tmp = i
    a[0] = tmp


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

def sort(a):
    find_position_of_smallest(a, i)
    i = tmp
    a[0] = tmp


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

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

def sort(a):
    i = 0
    while i < len(a):
        find_position_of_smallest(a, i)
        swap(a, i, j)


def sort(a):
    tmp = a[p]
    a[p] = a[i]
    a[i] = tmp
    i = i + 1


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

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

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


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

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

def sort(a):
    i = 0
    while i < len(a):
        find_position_of_smallest(a, i)
        swap(a, i, tmp)


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

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

def sort(a):
    i = 0
    j = 0
    while i < len(a):
        find_position_of_smallest(a, i)
        swap(a, i, j)


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

def find_position_of_smallest(a, i):
    track = 0
    tempnum = a[i + track]
    while track != len(a) - i:
        if a[i + track] == tempnum:
            tempnum = a[i + track]
        track = track + 1
    return tempnum

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


def sort(a):
    tmp = a[j]
    a[j] = a[i]
    a[i] = tmp
    i = i + 1


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


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


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


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


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


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


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


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

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

def sort(a):
    i = 0
    j = 0
    while j < len(a):
        find_position_of_smallest(a, i)
        swap(a, i, j)
        find_position_of_smallest


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


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

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

def sort(a):
    i = 0
    j = 0
    while j < len(a):
        find_position_of_smallest(a, i)
        swap(a, i, j)


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


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

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


def sort(a):
    i = 0
    while i < len(a):
        j = i
        k = i + 1
        while k < len(a):
            if a[k] < a[j]:
                j = k
            k = k + 1
        tmp = a[j]
        a[j] = a[i]
        a[i] = tmp
        i = i + 1


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

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


def sort(a):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp


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


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

def find_position_of_smallest(a, i):
    track = 0
    tempnum = a[i + track]
    while track != len(a) - i:
        if a[i + track] < tempnum:
            tempnum = a[i + track]
        track = track + 1
    return track + i - 1

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


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


def 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 = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


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


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

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

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


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


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


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


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

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

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


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


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

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

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


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


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

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

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


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


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


def sort(a):
    i = 0
    while i < len(a):
        j = i
        k = i + 1
        while k < len(a):
            if a[k] < a[j]:
                j = k
            k = k + 1
        tmp = a[j]
        a[j] = a[k]
        a[k] = tmp
    i = i + 1


def sort(a):
    i = 0
    while i < len(a):
        j = i
        k = i + 1
        while k < len(a):
            if a[k] < a[j]:
                j = k
            k = k + 1
        tmp = a[j]
        a[j] = a[i]
        a[i] = tmp
    i = i + 1


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

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

def sort(a):
    find_position_of_smallest(a, i)
    swap(a, i, j)


def sort(a):
    i = 0
    while i < len(a):
        j = i
        k = i + 1
        while k < len(a):
            if a[k] < a[j]:
                j = k
            k = k + 1
        tmp = a[j]
        a[j] = a[i]
        a[i] = tmp
        i = i + 1


def 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 = j + 1
    tmp = a[p]
    a[p] = a[i]
    a[i] = tmp
    i = i + 1


def 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 = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


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, j)
    i = i + 1


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, j)
        i = i + 1


def swap(a, i, j):
    tmp = a[j]
    a[j] = a[i]
    a[i] = 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, p, i)
        i = i + 1


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

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

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


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, p, i)
        i = i + 1


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

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

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


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

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


def sort(a):
    i = 0
    while i < len(a):
        p = i
        i = i + 1
        while i < len(a):
            if a[i] < a[p]:
                p = i
            i = i + 1
        swap
        i = i + 1


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

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


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

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

def sort(a):
    i = 0
    while i < len(a):
        find_position_of_smallest(a, i)
        swap(a, i, j)


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

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

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


def 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 = j + 1
        temp = a[p]
        a[p] = a[i]
        a[i] = temp
        i = i + 1


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

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

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


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

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

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


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

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

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


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

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

def sort(a):
    i = 0
    j = 0
    find_position_of_smallest(a, i)
    swap(a, i, j)
    i = i + 1


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

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

def sort(a):
    find_position_of_smallest(a, i)
    swap(a, i, j)
    i = i + 1


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

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

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


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

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

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


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

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

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


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

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


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

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

def sort(a):
    i = 0
    find_position_of_smallest(a, i)
    swap(a, i, j)
    i = i + 1


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

def sort(a):
    i = 0
    while i < len(a):
        j = i + 1
        find_position - of - smallest(a, i)
        swap(a, i, j)
        i = i + 1


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

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

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


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

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

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


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

def sort(a):
    while i < len(a):
        p = find_first_position_of_smallest(a, i)
        swap(a, j, i)


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

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


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

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

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


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, p, i)
        i = i + 1


def 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 = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def sort(a):
    tmp = a[p]
    a[p] = a[i]
    a[i] = tmp
    i = i + 1


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

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

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


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

def find_position_of_smallest(a, i):
    p = i
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 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


def sort(p):
    tmp = a[p]
    a[p] = a[i]
    a[i] = tmp
    i = i + 1


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

def find_position_of_smallest(a, i):
    p = i
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 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


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

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

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


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

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


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

def find_position_of_smallest(a, i):
    p = i
    j = i
    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, p, i)
        i = i + 1


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

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


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

def find_position_of_smallest(a, i):
    l = a[i:]
    s = 0
    j = 0
    while j < len(l):
        if l[j] < l[s]:
            s = j
        j += 1
    return s + len(a) - len(l)

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


def sort(a):
    x = int(a[0])
    i = 0
    while i < len(a) - 1:
        if int(a[i]) > int(a[i + 1]):
            x = a[i]
            a[i] = a[i + 1]
            a[i + 1] = x
        i = i + 1
    i = 0
    while i < len(a):
        print(a[i])
        i = i + 1


def sort(a):
    x = int(a[0])
    i = 0
    while i < len(a) - 1:
        if int(a[i]) > int(a[i + 1]):
            x = a[i]
            a[i] = a[i + 1]
            a[i + 1] = x
        i = i + 1
    i = 0
    while i < len(a):
        i = i + 1


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


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

Return the area of a square.


Return the area of a square.


def square_perimeter(n):
    sq = n + n + n + n
    return sq

Returns the perimeter of a square.


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

Return the circumference of a circle.


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

Return the area of a circle.


def rectangle_perimeter(n, b):
    sq = n + n + b + b
    return sq


Returns the perimeter of a square.


Return the area of a circle.


Return the circumference of a circle.


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

Return the area of a square.


def circle_area(r):
    cir = 3.14 * (r * r)
    return cir

Return the area of a circle.


def circle_circumference(r):
    circum = 2 * 3.14 * r
    return circum

Return the circumference of a circle.


def square_perimeter(side):
    perimeter = side * 4
    return perimeter

Returns the perimeter of a square.


def rectangle_perimeter(a, b):
    per = a * 2 + b * 2
    return per


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

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

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


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

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


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 += 1


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, p, i)
        i = i + 1


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

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

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


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

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


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

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

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


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

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

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


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

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


def circle_circumference(r):
    circle_circumference = 2 * 3.14 * r
    return circle_circumference

Return the circumference of a circle.


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

Return the area of a square.


def square_perimeter(n):
    square_perimeter = n * 4
    return square_perimeter

Returns the perimeter of a square.


def circle_area(r):
    circle_area = r * r * 3.14
    return circle_area

Return the area of a circle.


def 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 = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def sort(a):
    i = 0
    while i < len(a):
        j = i
        k = i + 1
        while k < len(a):
            if a[k] < a[j]:
                j = k
            k = k + 1
        tmp = a[j]
        a[j] = a[i]
        a[i] = tmp
        i = i + 1


Returns the perimeter of a square.


Return the area of a square.


Return the circumference of a circle.


Return the area of a circle.


def swap(a, i, j):
    tmp = a[j]
    a[j] = a[i]
    a[i] = 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


def rectangle_perimeter(x1, y1, x2, y2):
    dx = x1 - x2
    dy = y1 - y2
    area = dx * dy
    if 0 <= area:
        return area


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

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

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


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

Return the area of a square.


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


def sort(a):
    p = i + 1
    i = i + 2
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
    return p


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 = p + 1
    while i < len(a):
        if a[j] < a[p]:
            p = j
            i = i + 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
    return p


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, p, i)
        i = i + 1


def rectangle_perimeter(x1, y1, x2, y2):
    dx = x1 - x2
    dy = y1 - y2
    perimeter = dx * dy
    if 0 <= area:
        return area


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

Return the area of a square.


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


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 = p + 1
    while i < len(a):
        if a[p] < a[j]:
            j = p
            i = i + 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
    return p


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 = p + 1
    while i < len(a):
        if a[p] < a[j]:
            j = p
        i = i + 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
    return p


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

Return the area of a square.


Return the area of a square.


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 = 1


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 = p + 1
    while i < len(a):
        if a[j] < a[p]:
            j = p
        i = i + 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
    return p


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 += 1


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


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


def 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 = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp


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


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 = p + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        i = i + 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
    return p


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
        i = i + 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
    return p


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


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
    return p


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


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


def circle_area(r):
    circle_area = r * r * 3.14
    return circle_area

Return the area of a circle.


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

Return the area of a square.


def square_perimeter(n):
    square_perimeter = n * 4
    return square_perimeter

Returns the perimeter of a square.


def rectangle_perimeter(x1, y1):
    rectancle_perimeter = 2 * x1 * y1
    return rectangle_perimeter


def circle_circumference(r):
    circle_circumference = 2 * 3.14 * r
    return circle_circumference

Return the circumference of a circle.


Return the area of a circle.


Return the area of a square.


Returns the perimeter of a square.


Return the circumference of a circle.


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

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

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


def rectangle_perimeter(r, n):
    rectangle_perimeter = (2)(n + r)
    return rectangle_perimeter


def square_area(r):
    square_area = r * r
    return square_area

Return the area of a square.


def square_perimeter(r):
    sqaure_perimeter = r * 4
    return square_perimeter

Returns the perimeter of a square.


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

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


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


def rectangle_perimeter(x1, y1):
    rectancle_perimeter = 2 * (x1 * y1)
    return rectangle_perimeter


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


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


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


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

def find_position_of_smallest(a, i):
    p = i
    i = i + 1
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 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


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

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


def circle_area(r):
    circle_area = r * r * 3.14
    return circle_area

Return the area of a circle.


def rectangle_perimeter(r, n):
    rectangle_perimeter = (2)(r + n)
    return rectangle_perimeter


Return the area of a square.


def square_perimeter(r):
    sqaure_perimeter = r * r * r * r
    return square_perimeter

Returns the perimeter of a square.


Return the area of a circle.


Return the circumference of a circle.


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

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

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


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
    find_position_of_smallest(a, i)
    swap(a, i, j)
    i = i + 1


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
    j = i + 1
    find_position_of_smallest(a, i)
    swap(a, i, j)
    i = i + 1


Returns the perimeter of a square.


def circle_circumference(r):
    circle_circumference = 2 * 3.14 * r
    return circle_circumference

Return the circumference of a circle.


def square_area(r):
    square_area = r * r
    return square_area

Return the area of a square.


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
    j = i + 1
    find_position_of_smallest(a, i)
    swap(a, i, j)
    j = j + 1
    i = i + 1


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

Return the area of a square.


def square_perimeter(n):
    square_perimeter = n * 4
    return square_perimeter

Returns the perimeter of a square.


def 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 = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def square_perimeter(n):
    sqaure_perimeter = n * 4
    return square_perimeter

Returns the perimeter of a square.


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():
    i = 0
    while i < len(a):
        p = find_position_of_smallest(a, i)
        swap(a, p, i)
        i = i + 1


def swap(a, i, j):
    tmp = a[j]
    a[j] = a[i]
    a[i] = 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


Return the area of a square.


def rectangle_perimeter(x1, y1):
    rectancle_perimeter = (2)(x1 * y1)
    return rectangle_perimeter


Return the area of a circle.


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
    j = i + 1
    while i < len(a):
        find_position_of_smallest(a, i)
        swap(a, i, j)
    j = j + 1
    i = i + 1


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
    j = i + 1
    while i < len(a):
        find_position_of_smallest(a, i)
        swap(a, i, j)
    j = i
    i = i + 1


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, p, i)
        i = i + 1


Return the circumference of a circle.