hex2bin[h] will give the value for the key 'h'.
i executed each statement separately, without declaring the dictionary and the output will make things very clear to you
>>number=1000
>>for h in '%X'%number:
print h
3
E
8
now you can see that 'h' gets values 3,E,8. All these values are 'key's in the dictionary hex2bin. lets see what are the values for each key
hex2bin[3] = 0011
hex2bin[E] = 1110
hex2bin[8] = 1000
0011 1110 1000
hence 'join' is joining these 3 strings and stripping(lstrip) the leading 0's hence the output
1111101000
Agni
Practically a Master Poster
655 posts since Dec 2007
Reputation Points: 431
Solved Threads: 116
woooee
Nearly a Posting Maven
2,454 posts since Dec 2006
Reputation Points: 777
Solved Threads: 714