title: How to convert a number into a linked list of its digits in python
body: <p>I was asked to convert a number into a linked list of its digits:
  ex:<code>head = number_to_list(120)</code> number_to_list is the function I should write and it should return a list of its  digits <code>listutils.from_linked_list(head) == [1,2,0]</code> without using  datastructures like list and dicts.I tried to write inthis way:</p>
  
  <pre><code>def number_to_list(number):        
      head,tail = None,None
      for x in number:
          node = Node(x)
          if head:
             tail.next = node
          else:
             head = node
             tail = node
      second = head.next
      third = second.next
      fourth = third.next
  </code></pre>
  
  <p>But I know that I'm totally wrong because in the for loop I should write the code in such a way that it goes to the first digit of the number and create a node of it.I'm blocked here.Please help me with this.</p>