[2,3,4,7] --> "2-4,7" ?

Peter Hansen peter at engcorp.com
Fri May 30 06:50:00 EDT 2003


BOCQUET Jean-Francois wrote:
> 
> hello,
> just to notice that your problem is solved in perl with clean code :

LOL!!  Good one. :-)

> sub display {
>     my ($prefix, $first, $last) = @_;
>     return "$prefix$first" if $last eq $first;
>     return "$prefix$first-$last";
> }

[snip rest of line noise]

-bigoted-ly y'rs,
 Peter




More information about the Python-list mailing list