Python Program to find the largest and smallest number in an unsorted integer array?

class Arrays:
def init(self,array):
self.array = array

def sorting(self):
    print("The original array is: ",self.array)
    for i in range(len(self.array)):
        for j in range(i+1,len(self.array)):
            if(self.array[i] > self.array[j]):
                temp = self.array[i]
                self.array[i] = self.array[j]
                self.array[j] = temp
    print("after sorted: ",self.array)
    
def largest_no(self):
    print("the largest is: ",self.array[0])
    
def smallest_no(self):
    print("the smallest is: ",self.array[-1])

x=Arrays([1,23,5,6,3,14])
x.sorting()
x.largest_no()
x.smallest_no()

you can use
x,y = y,x
to swap two elements rather then using,

x = temp
y=x
temp = x

@kharshavardhan31 @rahulgoyal1245

Nice explanation, keep the pace up :relaxed:.
Keep Practicing more.