Python equivalent to the "A" or "a" output conversions in C

Mark Lawrence breamoreboy at yahoo.co.uk
Tue Jun 19 13:12:37 EDT 2012


On 19/06/2012 17:23, Edward C. Jones wrote:
> Consider the following line in C:
> printf('%a\n', x);
> where x is a float or double. This outputs a hexadecimal representation
> of x. Can I do this in Python?
>

See this http://docs.python.org/library/string.html#format-examples

-- 
Cheers.

Mark Lawrence.




More information about the Python-list mailing list