In [7]:
def get_index_of_smallest(numbers):
    smallest_index = []
    for element in range (len(numbers)):
        element = numbers.index(min(numbers))
        smallest_index = element + 1
    return smallest_index

def test_get_index_of_smallest():
    list1 = [23, 3, 6, 5, 12, 9, 7, 4]
    print(get_index_of_smallest(list1))

test_get_index_of_smallest()
2
In [10]:
def isPalindrome(string):
    left_pos = 0
    right_pos = len(string) - 1
    while right_pos >= left_pos:
        if not string[left_pos] == string[right_pos]:
            return False
        left_pos += 1
        right_pos -= 1
        return True
print(isPalindrome('aza')) 
True
In [11]:
def isPalindrome(string):
    left_pos = 0
    right_pos = len(string) - 1
    while right_pos >= left_pos:
        if not string[left_pos] == string[right_pos]:
            return False
        left_pos += 1
        right_pos -= 1
        return True
print(isPalindrome('azaaad')) 
False
In [22]:
name=(["Jane", "Aaron", "Jane", "Cindy", "Aaron"])
In [24]:
def get_count(lst):
    lst.sort()
    d = {}
    for item in lst:
        if item not in d:
            d[item] = [1]
        else:
            d[item].append(1)
    def get_count_child(d):
        fd = {}
        for key, value in d.items():
            fd[key] = sum(value)
        return fd
    return get_count(d)
In [ ]: