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()
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'))
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'))
name=(["Jane", "Aaron", "Jane", "Cindy", "Aaron"])
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)