def reverse(a):
    i = 0
    while i < len(a):
        print(a[len(a) - i - 1])
        i = i + 1

Reverse a list of elements.


Reverse a list of elements.


Reverse a list of elements.

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


Reverse a list of elements.

def reverse(a):
    a.reverse()
    return a


def reverse(a):
    import sys
    a = sys.stdin.readlines()
    i = 0
    b = []
    while i < len(a):
        f = a[len(a) - i - 1]
        i = i + 1
        b.append(f.rstrip())
    print(b)
    return a

Reverse a list of elements.


Reverse a list of elements.

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


Reverse a list of elements.

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

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


Reverse a list of elements.

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


Reverse a list of elements.

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

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


Reverse a list of elements.

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

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


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

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

Reverse a list of elements.


Reverse a list of elements.

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

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


Reverse a list of elements.

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

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


Reverse a list of elements.

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

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


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

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

Reverse a list of elements.

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

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


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

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

Reverse a list of elements.

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

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


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

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

Reverse a list of elements.


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

Return whether a letter is part of a string

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

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


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


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


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

def search(str, letter):
    for item in str:
        if item == letter:
            return True
    return False


def search(str, letter):
    for item in str:
        if item == letter:
            return False
        return True


def search(str, letter):
    for item in str:
        if item == letter:
            return True
        return False


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


def search(string, letter):
    if letter in string:
        print('True')
    else:
        print('False')
    return string

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


def search(string, letter):
    if letter in string:
        print('True')
    else:
        print('False')
    return 1


def search(string, letter):
    if letter in string:
        print('True')
    else:
        print('False')
    return letter


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


def search(string, letter):
    i = 0
    while i < len(string):
        if letter == string[i]:
            return 'True'
        elif letter != string[-1]:
            return 'False'

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


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


def search(string, letter):
    i = 0
    if string[i] == letter:
        return True
    else:
        search(string[i + 1], letter)

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


def search(string, letter):
    i = 0
    if string[i] == letter:
        return True
    else:
        i = i + 1
        search(string[i], letter)

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


def search(string, letter, count):
    i = 0
    if string[i] == letter:
        return True
    else:
        count = i + 1
        search(string[count], letter, count)


def search(string, letter):
    i = 0
    if string[i] == letter:
        return True
    else:
        count = i + 1
        search(string[count], letter, count)


def search(string, *letter):
    i = 0
    if string[i] == letter[0]:
        return True
    else:
        count = i + 1
        search(string[count], letter[0])


def search(string, letter):
    if not i:
        i = 0
    if string[i] == letter:
        return True
    else:
        search(string[i + 1], letter)


def search(string, letter):
    if i not in search():
        i = 0
    if string[i] == letter:
        return True
    else:
        search(string[i + 1], letter)


def search(string, letter):
    if 'i' not in locals():
        i = 0
    if string[i] == letter:
        return True
    else:
        search(string[i + 1], letter)


def search(string, letter):
    if 'i' not in locals():
        i = 0
    if string[i] == letter:
        return True
    elif i < len(string):
        search(string[i + 1], letter)


def search(string, letter):
    if 'i' not in locals():
        i = 0
    if string[i] == letter:
        return True
    elif i < len(string):
        search(string[i + 1], letter)
    else:
        return False


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


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

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


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


def search(string, letter, pos):
    if pos == len(string):
        return False
    elif string[pos] == letter:
        return True
    else:
        search(string, letter, pos + 1)


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

def search(str, letter):
    for char in str:
        if char == letter:
            return True
    return False


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


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

def search(str, letter):
    for c in str:
        if letter == c:
            return True
    return False


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


def search(str, letter):
    if letter in str:
        print('True')
    elif letter not in str:
        print('False')

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


def search(str, letter):
    i = 0
    while i < len(str):
        if letter == str[i]:
            break
            print('True')
        else:
            print('False')

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


def search(str, letter):
    i = 0
    while i < len(str):
        if letter == str[i]:
            print('True')
        else:
            print('False')


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


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


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


def search(string, letter):
    i = 0
    while i < len(string):
        if letter in string:
            return 'True'
        else:
            return 'False'


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

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


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


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


def search(s, letter, pos):
    if pos == len(s):
        print('False')
    elif s[pos] == letter:
        print('True')
    else:
        return search(s, letter, pos + 1)

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


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


def search(s, letter, pos):
    if pos == len(s):
        print('-1')
    elif s[pos] == letter:
        print(pos)
    else:
        return search(s, letter, pos + 1)


def search(s, letter, pos):
    if pos == len(s):
        print('-1')
    elif s[pos] == letter:
        return pos
    else:
        return search(s, letter, pos + 1)


def maximum(l):
    return l.sort()
    l[-1]

Return the maximum element in a list of numbers.

def maximum(l):
    l.sort()
    return l[-1]


def maximum(l):
    A = 'null'
    highest = A
    for c in l:
        if maximum == A:
            maximum = c
        elif c > maximum:
            maximum = c
    return maximum

def maximum(l):
    A = 'null'
    highest = A
    for c in l:
        if highest == A:
            highest = c
        elif c > highest:
            highest = c
    return highest


def maximum(l):
    biggest = l[0]
    for e in l:
        if e < biggest:
            biggest = e
    return biggest

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


def maximum(l):
    max = -1 * sum(l)
    for i in l:
        if i > max:
            max = i
    return max

def maximum(l):
    max = l[0]
    for i in l:
        if i > max:
            max = i
    return max


def maximum(l):
    if len(l) == 1:
        return l[0]
    if l[0] > l[1]:
        l.remove(l[1])
    else:
        l.remove(l[1])
    return maximum(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 maximum(collection, itera=0, mini=None):
    if itera == 0:
        mini = collection[0]
    if len(collection) == itera:
        return mini
    if mini < collection[itera]:
        mini = collection[itera]
        return minimum(collection, itera + 1, mini)
    else:
        return minimum(collection, itera + 1, mini)

def maximum(collection, itera=0, mini=None):
    if itera == 0:
        mini = collection[0]
    if len(collection) == itera:
        return mini
    if mini < collection[itera]:
        mini = collection[itera]
        return maximum(collection, itera + 1, mini)
    else:
        return maximum(collection, itera + 1, mini)


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

Return the minimum element in a list of numbers.

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


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

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


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

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


def maximum(l, c=None):
    if c == None:
        return minimum(l[1:], l[0])
    if l == []:
        return c
    if l[0] > c:
        return minimum(l[1:], l[0])
    else:
        return minimum(l[1:], c)

def maximum(l, c=None):
    if c == None:
        return maximum(l[1:], l[0])
    if l == []:
        return c
    if l[0] > c:
        return maximum(l[1:], l[0])
    else:
        return maximum(l[1:], c)


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

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


def maximum(list_1):
    i = 0
    total = 0
    while i < len(list_1):
        if int(list_1[i]) >= int(total):
            total = list_1[i]
        else:
            0
        i = i + 1
    return total

def maximum(list_1):
    i = 0
    total = list_1[0]
    while i < len(list_1):
        if int(list_1[i]) >= int(total):
            total = list_1[i]
        else:
            0
        i = i + 1
    return total


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

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


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


def maximum(a):
    highest = 0
    for e in a:
        if e > highest:
            highest = e
    return highest

def maximum(l):
    m = l[0]
    for line in l:
        if line > m:
            m = line
    return m


def minimum(l):
    l = sorted(minimum(l))
    return l[0]

def minimum(l):
    l = sorted(l)
    return l[0]


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

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


def maximum(a, tmp=0):
    if a == []:
        return tmp
    if tmp == 0 or a[-1] > tmp:
        tmp = a[-1]
    return minimum(a[:-1], tmp)

def maximum(a, tmp=None):
    if a == []:
        return tmp
    if tmp == None or a[-1] > tmp:
        tmp = a[-1]
    return maximum(a[:-1], tmp)


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

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


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

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


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

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


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


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

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


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

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


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


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

def maximum(l, old_max=None):
    item = l[0]
    if len(l) == 1:
        return item if old_max == None or item > old_max else old_max
    if item != None:
        new_l = l[1:]
        return 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


Reverse a list of elements.

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


Reverse a list of elements.


Reverse a list of elements.

def reverse(a):
    print(a.reverse())
    return a


Reverse a list of elements.

def reverse(a):
    a.reverse()
    return a


Reverse a list of elements.

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


def reverse(a, i):
    i = 0
    lines = sys.stdin.readlines()
    while i < len(a):
        print(lines[i] - 1 - i)
    i = i + 1
    return a

Reverse a list of elements.


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

Reverse a list of elements.


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

Reverse a list of elements.


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

Reverse a list of elements.


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

Reverse a list of elements.


def reverse(a):
    i = 0
    while i < len(a):
        tmp = a[i]
        a[i] = a[len(a) - i - 1]
        a[len(a) - i - 1] = a[i]
    return a

Reverse a list of elements.

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


def reverse(a):
    i = 0
    j = len(a)
    while i < len(a):
        tmp = a[i]
        a[i] = a[j - i]
        a[j - i] = tmp
        i = i + 1
    print(a)

Reverse a list of elements.

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


def reverse(test):
    n = len(test)
    x = ''
    for i in range(n - 1, -1, -1):
        x += test[i]
    return x

Reverse a list of elements.

def reverse(test):
    n = len(test)
    x = []
    for i in range(n - 1, -1, -1):
        x.append(test[i])
    return x


def reverse(a):
    i = 0
    while i < len(a):
        tmp = a[i]
        a[i] = a[len(a) - i]
        a[len(a) - i] = tmp
        i = i + 1
    print(a)

Reverse a list of elements.


def reverse(a):
    a = []
    i = 0
    while i < len(a):
        tmp = a[i]
        a[i] = a[len(a) - i - 1]
        a[len(a) - i - 1] = a[i]
    return a

Reverse a list of elements.


def reverse(a):
    i = 0
    while i < len(a):
        tmp = a[i]
        a[i] = a[len(a) - i - 1]
        a[len(a) - i - 1] = tmp
        i = i + 1
    print(a)

Reverse a list of elements.


def reverse(a):
    i = 0
    while i < len(a):
        tmp = a[i]
        a[i] = a[len(a) - i - 1]
        a[len(a) - i - 1] = tmp
        i = i + 1
    print(a.rstrip())
    print(tmp)
    print(a[i])

Reverse a list of elements.


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

Reverse a list of elements.


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

Reverse a list of elements.


Reverse a list of elements.


def reverse(a):
    temp = []
    i = 0
    while i != len(a):
        temp.append(len(a) - 1)
        i = i + 1
    a = temp
    return a

Reverse a list of elements.

def reverse(a):
    temp = []
    i = 0
    while i != len(a):
        temp.append(a[len(a) - i - 1])
        i = i + 1
    a = temp
    return a


def reverse(a):
    temp = []
    i = 0
    while i != len(a):
        temp.append(len(a) - i)
        i = i + 1
    a = temp
    return a

Reverse a list of elements.


def reverse(a):
    temp = []
    i = 0
    while i != len(a):
        temp.append(a[len(a) - i])
        i = i + 1
    a = temp
    return a

Reverse a list of elements.


Reverse a list of elements.

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


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

Reverse a list of elements.

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


Reverse a list of elements.

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


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

def reverse(a):
    return swap(a, 2, 3)

Reverse a list of elements.


Reverse a list of elements.

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

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


Reverse a list of elements.

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


def search(str, letter):
    for item in str:
        return True
    return False

def search(str, letter):
    for item in str:
        if item == letter:
            return True
    return False


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

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


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):
    quicksort(a, 0, len(a) - 1)
    return a[-1]


def search(s, letter):
    print(letter in s)


def search(x, letter):
    if letter.isalpha() and type(x) == str:
        print('ok')
    else:
        print('false')


def search(x, letter):
    if letter.isalpha() and type(x) == str:
        print('True')
    else:
        print('False')


def search(x, letter):
    if letter.isalpha() and type(x) == str:
        print('True')
    else:
        print('False')
    return


def search(x, letter):
    if letter.isalpha() and type(x) == str:
        return 'True'
    else:
        return 'False'


def search(x, letter):
    if type(x) == str and letter.isalpha():
        return 'True'
    else:
        return 'False'


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

Swap keys with values.

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


def swap_keys_values(d):
    new_dict = {v: k for k, v in list(d.items())}
    print(sorted(new_dict.items()))

Swap keys with values.

def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    return d


def swap_keys_values(dict):
    new_dict = {v: k for k, v in list(dict.items())}
    print([new_dict])

Swap keys with values.

def swap_keys_values(dict):
    new_dict = {v: k for k, v in list(dict.items())}
    return new_dict


def my_function(a):
    return a[1]

def swap_keys_values(dict):
    l = []
    new_dict = {v: k for k, v in list(dict.items())}

    def my_function(a):
        return a[1]
    for k in new_dict:
        l.append('({} : {})'.format(k, new_dict[k]))
    print('[' + ', '.join(sorted(l, key=my_function)) + ']')

Swap keys with values.

def swap_keys_values(dict):
    l = []
    new_dict = {v: k for k, v in list(dict.items())}
    return new_dict


def my_function(a):
    return a[1]

def swap_keys_values(dict):
    l = []
    new_dict = {v: k for k, v in list(dict.items())}

    def my_function(a):
        return a[1]
    for k in new_dict:
        l.append('({} : {})'.format(int(k), new_dict[k]))
    print('[' + ', '.join(sorted(l, key=itemgetter(-2))) + ']')
    print(type(l[1]))

Swap keys with values.


def swap_keys_values(d):
    {v: k for k, v in d.items}
    return d

Swap keys with values.

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


Swap keys with values.


def swap_keys_values(d):
    new = {}
    for z, q in list(d.items()):
        new[q] = z
    return list(new.items())

Swap keys with values.

def swap_keys_values(d):
    new = {}
    for z, q in list(d.items()):
        new[q] = z
    return new


def swap_keys_values(d):
    list(zip(list(d.values()), list(d.keys())))

Swap keys with values.

def swap_keys_values(d):
    return dict(zip(list(d.values()), list(d.keys())))


def swap_keys_values(d):
    d1 = {v: k for k, v in list(d.items())}
    print(list(d1.items()).sorted())

Swap keys with values.


Swap keys with values.

def swap_keys_values(d):
    d = dict((v, k) for k, v in d.items())
    return d


def swap_keys_values(d):
    print(dict((v, k) for k, v in d.items()))

Swap keys with values.


def swap_keys_values(d):
    print(dict((v, k) for k, v in list(d.items())))

Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    print(list(d.items()))

Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    list(d.items())

Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    print(sorted(list(d.items())))

Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    d = collections.OrderedDict(sorted(list(d.items()), key=lambda t: t[0]))
    print(d)

Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    d = sorted(list(d.items()), key=lambda t: t[0])
    print(list(d.items()))

Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    d = SortedDict(d)
    print(d.items)

Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    print(sorted(d.items()))

Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    print(sorted(list(d.items()), key=sorter))

Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    d = list(d.items())
    print(d)

Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    print(d)

Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    print(sorted(list(d.items()), key=lambda x: x[1]))

Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    sd = sorted(d.items())
    print(sd)

Swap keys with values.


Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    print(sorted(d))

Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    d = sorted(d)
    print(d)

Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    d = sorted(list(d.items()), key=lambda t: t[0])
    print(d)

Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    new_dict = sorted(list(d.items()), key=lambda t: t[0])
    print(new_dict)

Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    print(new_dict)

Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))
    print(sorted(list(d.items()), key=lambda t: t[0]))

Swap keys with values.


def swap_keys_values(d):
    d = dict((v, k) for k, v in list(d.items()))

Swap keys with values.


Swap keys with values.

def swap_keys_values(d):
    new_dict = dict((v, k) for k, v in list(d.items()))
    return new_dict


def swap_keys_values(d):
    new_d = d((v, k) for k, v in list(d.items()))
    return new_d

Swap keys with values.

def swap_keys_values(d):
    new_d = dict((v, k) for k, v in list(d.items()))
    return new_d


def swap_keys_values(d):
    new_dict = dict((k, v) for k, v in list(d.items()))
    return new_dict

Swap keys with values.


def minimum(l):
    l = l.sort()
    return l[0]

def minimum(l):
    l.sort()
    return l[0]


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

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


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

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


def minimum(l):
    a = l[len(l) - 1]
    if len(a) == 1:
        return l[0]
    if a >= minimum(l):
        return minimum([j for j in l[:-1]])

def minimum(l):
    if len(l) == 1:
        return l[0]
    a = l[len(l) - 1]
    if a >= minimum(l[:-1]):
        return minimum([j for j in l[:-1]])
    return a


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

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


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

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


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

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


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()

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 minimum(l):
    if len(l) == 1:
        return l[0]
    tmp = minimum(l[1:])
    return tmp if tmp > l[0] else l[0]

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


def minimum(a):
    if a == []:
        return 1
    tmp = a.pop()
    if tmp < minimun(a):
        return tmp


def minimum(a):
    if a.pop() < a[-1]:
        tmp = a.pop()
    if a == []:
        return tmp
    return minimum(a)


def minimum(a):
    if a == []:
        return tmp
    if a.pop() < a[-1]:
        tmp = a.pop()
    return minimum(a)


def minimum(a):
    if a == []:
        return b[0]
    if a[-1] < a[-2]:
        b.append(a[-1])
        if len(b) > 1:
            if b[0] > b[1]:
                b.remove(b[0])
            else:
                b.remove(b[1])
    return minimum(a[:-1])


def minimum(l):
    if l == []:
        return []
    temp = minimum(l[1:])
    if l[0] > temp[0]:
        temp = [l[0]]
    return temp[0]

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


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

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


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 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(l):
    min = inf
    for item in l:
        min = item if item < min else min
    return min

def minimum(l):
    min = l[0]
    for item in l:
        min = item if item < min else min
    return min


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)