Skip to main content

Posts

Showing posts with the label array

Python Program to find minimum and maximum elements in the array

        Python Program to find minimum and maximum elements in the array     A number which is less than other number is said as minimum number and another number is called as maximum number. In this post we are going to write solution for minimum nd maximum element in the array      Input:          1 2 3 4      Out put:            minimum element=1          maximum element=4      Explanation:          [1,2 ,3 ,4]          min = 1 , max =4        Code:          arr=list(map(int,input().split()))           print("minimum element=",min(arr))          print("maximum element=",max(arr))           Note:     Hello Guys, Don't Stop Learning keep Goin...

Python Program to find sum of array of elements

       Python Program to find sum of array of elements    Array is a collection of similar datatype which are stored in sequencial order. In this post we are going to find sum of the array elements in the array or list.      Input:          1 2 3 4      Out put:            10      Explanation :           [1,2,3,4]          sum = 1 + 2 + 3 +4 = 10 (desired output).        Code:          arr=list(map(int,input().split()))           print(sum(arr))           Note:     Hello Guys, Don't Stop Learning keep Going..............