how to implement the same result with less the code?
here\'s my complete code
class Node: def __init__(self, dat