Python Program to find the smallest element of an array
In this program, you will learn how to find the smallest element of an array in Python.
In this program, you will learn how to find the smallest element of an array in Python.
a = arr.array('i', [40, 30, 10, 90, 55])
import array as arr
a = arr.array('i', [40, 30, 10, 90, 55])
smallest = a[0]
for i in a:
if smallest > i:
smallest = i
print("Smallest element is : ", smallest)
Smallest element is : 10