[Tutor] Concatenating string

Dave Angel davea at ieee.org
Wed Feb 23 03:20:53 CET 2011


On 01/-10/-28163 02:59 PM, tee chwee liong wrote:
>
> hi Francesco,
>
> couldnt get hex of bin working on IDLE Python 2.5 when i type:
>
>>>> hex(0b1001001001001001001)
> SyntaxError: invalid syntax
>>>> bin(0x49249)
> Traceback (most recent call last):
>    File "<pyshell#126>", line 1, in<module>
>      bin(0x49249)
> NameError: name 'bin' is not defined
>
> pls advise.
>
> thanks
> tcl
>   		 	   		
Just read the docs:

http://docs.python.org/library/functions.html#bin

According to that page, this function was new in version 2.6

DaveA



More information about the Tutor mailing list