我有这个代码:
number = ord('C')
number = ord('a') + (number << 8)
number = ord('t') + (number << 8)
print(bin(number))
code = number >> (6 * 3)
number = number - (code << (6 * 3))
code = number >> (6 * 2)
number = number - (code << (6 * 3))
code = number >> (6 * 1)
number = number - (code << (6 * 1)
print(chr(code))
但是这里报告了
SyntaxError
:
File "assign1.py", line 24
print(chr(code))
^
为什么?这是一行非常简单的代码,看起来没有任何错误。
您只是缺少一个右括号,又名
)
,在下面的句子中:
number = number - (code << (6 * 1)