split function

William Park opengeometry at yahoo.ca
Mon Aug 22 16:40:04 EDT 2005


Mohammed Altaj <mohammed at aims.ac.za> wrote:
> 
> Dear All
> 
> What i want to do is , my input is like
> 0 2
> 0 3
> 0 4
> 1 2
> 1 4
> 2 3
> 3 4
> 
> I am comparing and put the number in group , like ,the first three lines
> , all has zero as first input for each line, so the out put should look
> like
> 0 2 3 4
> and so on
> 1 2 4
> 2 3
> 3 4

Use Python's dictionary (also known as associative array or hash).  Read
documentation.

-- 
William Park <opengeometry at yahoo.ca>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
	   http://home.eol.ca/~parkw/thinflash.html
BashDiff: Super Bash shell
	  http://freshmeat.net/projects/bashdiff/



More information about the Python-list mailing list