进制转换 map

 

a_z = [i for i in map(chr, range(ord('a'), ord('z') + 1))]
'''
Address of var1 variable: 240ff24
Address of var2 variable: 240ff08
Address of var1 variable: 37814052
Address of var2 variable: 37814024
'''

s = '240ff24'
s = s.lower();
size = len(s)
base = 16
map_d = {}
for i in range(base):
if i <= 9:
map_d[str(i)] = i
else:
map_d[a_z[i - 10]] = i
n10 = 0
for i in range(size):
n10 += 16 ** i * map_d[s[size - 1 - i]]



def f(i):
return i * i

m = map(f, range(1, 10, 1))

l = [i for i in map(f, range(1, 10, 1))]




posted @ 2019-02-26 20:03  papering  阅读(240)  评论(0编辑  收藏  举报