title: list value validate in python
body: <p>Below input file has:</p>
  
  <pre><code> info:pens-10-books-10,pens-10-books-20
  </code></pre>
  
  <p>I am reading this input file using python dictionary like below.</p>
  
  <pre><code> d = {}
   with open('inputfile.txt') as f:
      for line in f:
      if ":" not in line:
          continue
      key, value = line.strip().split(":", 1)
      d[key] = value
  for key, value in  d.iteritems():
      if key == 'info':
          goods = value.split(",")
  </code></pre>
  
  <p>Now I need help here to validate the input provided that is. goods declared as list so i need validate list values. </p>
  
  <p>first octet must be alphabet, second octet must be number, third octet must be alphabet, fourth octet must be number. if contains more than 4  octets not valid input . Below are the examples</p>
  
  <pre><code>pens-10-books-10 --input valid
  apples-1-cakes-10 --input valid
  10-aplpes-10cakes --not valid input (as number contains at first octet)
  pens-10-books-20-apples-10 -- not valid input (more than 4 octets)
  </code></pre>