def reverse(self):
    temp = self.head
    self.head = None
    while (temp is not None):
        self.push(temp.data)
        temp = temp.next
def reverse(self):
    temp = self.head
    self.head = None
    while (temp is not None):
        self.push(temp.data)
        temp = temp.next