def minElem(A):
res = A[0]
for i in range(1, len(A)):
if A[i] < res:
res = A[i]
return res
n = map(int, input("Input the size of array: "))
a = list(map(int, input("Input array: ").split()))
ans = minElem(a)
print("Minimal element in array is: " + str(ans))
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
def minElem(A):
res = A[0]
for i in range(1, len(A)):
if A[i] < res:
res = A[i]
return res
n = map(int, input("Input the size of array: "))
a = list(map(int, input("Input array: ").split()))
ans = minElem(a)
print("Minimal element in array is: " + str(ans))