Find Smallest element in an array using Python

In this section we will learn how to find smallest element in an array with the help of Python language which is the scripting language. If we want to find smallest element from the array enter by the user so we have to compare one element to other until we get the desired element and print it.
FOR EXAMPLE:
ENTER ARRAY SIZE OF ARRAY 3
6
77
55
SMALLEST ELEMENT IS 6

Program to find Smallest element in an array using Python

Working Required for finding smallest element in an array:-

We can find smallest element in an array by following these steps:-
1. Initialize the required array size.
2. Use range function for working of the loop.
3.Take the input of array.
4. Print the smallest element in an array.

Program to find in an array using Python
size=int(input("ENTER ARRAY SIZE"))

arr=[]

for i in range(size):

    element=int(input())

    arr.append(element)

print("SMALLEST ELEMENT",min(arr))