simple question
Terry Reedy
tejarex at yahoo.com
Sat Mar 23 10:35:50 EST 2002
"Christopher Palmer" <ctp at ctpdesign.com> wrote in message
news:mailman.1016868517.25439.python-list at python.org...
> Let's say I have a variable called a
Actually, you have a name 'a'.
> and a contains an integer, say 4522
and the name is bound to an int, conventionally written 4522.
> and I want 4, 5, 2, and 2 to be items in a list instead of an
integer...
Do you want the list to contain 4 ints (answer given by Johann as:
map(int, str(a))
) or 4 digits:
''.split(str(a))
?
Terry J. Reedy
More information about the Python-list
mailing list