question about output
steve at REMOVETHIScyber.com.au
Wed Oct 5 16:59:38 CEST 2005
On Wed, 05 Oct 2005 07:24:31 -0700, Java and Swing wrote:
> i have printed out some numbers and they look like
They don't look like numbers to me. They have letters at the end. What are
they? What does the letter mean?
> ...if i want to later assign this type of number to variable how can i
> do it?
> for example i can't do...
>>> x = 10944800e
> ..since it says "invalid token" on the "e".
How did you get the "numbers"? If you just typed them in by hand, then
leave the "e" off and you have a number.
If they are supposed to be hex numbers, then you can use:
x = int("10944800e", 16) # note the quote marks
If you don't care about the numeric value, then you just put quote marks
around the number+letter:
x = "10944800e"
but then x will be a string, not a number.
If none of these answers is what you need, you will need to explain your
problem a little better.
More information about the Python-list