"""Write simple Python program that for the given array:
ar = [36.6, 37.3, 38.5, 39.1, 38.7, 36.2]
finds the largest element, print its value and its index.
Do not use any built in functions, that do that task."""
ar = [36.6, 37.3, 38.5, 39.1, 38.7, 36.2]
largest = ar[0]
index = 0
for i in range(1, len(ar)):
if largest < ar[i]:
largest = ar[i]
index = i
print("Largest element: ", largest)
print("index: ", index)