in reply to Adventures in multilingualism

I felt compelled to offer a version using glob to generate the combinations. It might not port so well to Python (but I don't really know what Python has).
#!perl use strict; use warnings; my %digit_letters = ( 2 => '{a,b,c}', 3 => '{d,e,f}', 4 => '{g,h,i}', 5 => '{j,k,l}', 6 => '{m,n,o}', 7 => '{p,r,s}', 8 => '{t,u,v}', 9 => '{w,x,y}', ); my $digit_glob = '{' . join(',', 2..9) . '}'; my $limit = 20; for my $num (glob($digit_glob x 4)) { (my $word_glob = $num) =~ s/(.)/$digit_letters{$1}/g; for my $word (glob $word_glob) { print "$num: $word\n"; } }

Caution: Contents may have been coded under pressure.