how do I factor a number down to one digit?

johnzenger at gmail.com johnzenger at gmail.com
Mon Feb 27 10:21:35 EST 2006


Your tools are:

1.  "map" lets you apply a function to every element of a list.
Strings are lists.  (List comprehensions let you do the same thing, but
"map" is better to use if you are turning in homework).
2.  "sum" lets you calculate the sum of all numbers in a list.
3.  "val" and "str" let you turn strings into numbers and numbers into
strings

The only missing piece is a function that turns a letter into a number.
 It shouldn't be that hard to write one.




More information about the Python-list mailing list