Program to find the maximum and minimum value node from a circular linked list

class Node:    

    def __init__(self,data):    

        self.data = data;    

        self.next = None;    

class CreateList:    

    def __init__(self):    

        self.head = Node(None);    

        self.tail = Node(None);    

        self.head.next = self.tail;    

        self.tail.next = self.head;      

    def add(self,data):    

        newNode = Node(data);    

        if self.head.data is None:    

            self.head = newNode;    

            self.tail = newNode;    

            newNode.next = self.head;    

        else:    

            self.tail.next = newNode;    

            self.tail = newNode;    

            self.tail.next = self.head;                 

    def minNode(self):    

        current = self.head;    

        minimum = self.head.data;    

        if(self.head == None):    

            print("List is empty");    

        else:    

            while(True):       

                if(minimum > current.data):    

                    minimum = current.data;    

                current= current.next;    

                if(current == self.head):    

                    break;    

        print("Minimum value node in the list: "+ str(minimum));    

    def maxNode(self):    

        current = self.head;    

        maximum = self.head.data;    

        if(self.head == None):    

            print("List is empty");    

        else:    

            while(True):       

                if(maximum < current.data):    

                    maximum = current.data;    

                current= current.next;    

                if(current == self.head):    

                    break;    

        print("Maximum value node in the list: "+ str(maximum));    

class CircularLinkedList:    

    cl = CreateList();    

    cl.add(5);    

    cl.add(20);    

    cl.add(10);    

    cl.add(1);    

    cl.minNode();    

    cl.maxNode();    


Vertical concatenation in matrix using loop

sample_list = [["Hi", "python"], ["welcome", "for"], ["to","engineers"]]

print("The original list : " + str(sample_list))

res = []

N = 0

while N != len(sample_list):

temp = ''

for idx in sample_list:

try: temp = temp + idx[N]

except IndexError: pass

res.append(temp)

N = N + 1

res = [ele for ele in res if ele]

print("List after column Concatenation : " + str(res))