Guest

Kirubakaran

By: a guest on Feb 6th, 2008  |  syntax: Python  |  size: 0.17 KB  |  hits: 26  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. def nexpand(e):
  2.         a=[]
  3.         if e=="": return []
  4.         l1=e.split(",")
  5.         for i1 in l1:
  6.                 l2=i1.split("-")
  7.                 for n in range(int(l2[0]),int(l2[-1])+1):
  8.                         a.append(n)
  9.         return a