同一串位,两种格式译出两种东西
运行下面这段程序,填写它打印出来的结果。
def decode_a(w):
return (w >> 6) & 3, (w >> 5) & 1, w & 31
def decode_b(w):
return (w >> 5) & 7, (w >> 3) & 3, w & 7
w = 0b01000111
a = decode_a(w)
b = decode_b(w)
print(str(a[0]) + "-" + str(a[2]) + "/" + str(b[0]) + "-" + str(b[2]))
全部评论