Generate the python dictionary of phone keypresses for any letter
perl, 49 48 bytes

Using a different algorithm than my previous answer, we can lose another 12 bytes. The basic idea is that you usually just add the digit from the last letter's solution over again. We handle the other cases (detected by a short regex) by starting with a single instance of the last digit + 1.

{map{$d++,$t=""if/[dgjmptw]/;$_,$t.=$d||=2}a..z}


With output:

ski@anito:~/src$ perl -MData::Dumper  -e '$Data::Dumper::Sortkeys=1; $d=2;print Dumper {map{$d++,$t=""if/[dgjmptw]/;$_,$t.=$d}a..z}'
$VAR1 = {
      'a' =&gt; '2',
      'b' =&gt; '22',
      'c' =&gt; '222',
      'd' =&gt; '3',
      'e' =&gt; '33',
      'f' =&gt; '333',
      'g' =&gt; '4',
      'h' =&gt; '44',
      'i' =&gt; '444',
      'j' =&gt; '5',
      'k' =&gt; '55',
      'l' =&gt; '555',
      'm' =&gt; '6',
      'n' =&gt; '66',
      'o' =&gt; '666',
      'p' =&gt; '7',
      'q' =&gt; '77',
      'r' =&gt; '777',
      's' =&gt; '7777',
      't' =&gt; '8',
      'u' =&gt; '88',
      'v' =&gt; '888',
      'w' =&gt; '9',
      'x' =&gt; '99',
      'y' =&gt; '999',
      'z' =&gt; '9999'
};