2015-02-06 76 views
0

noob here在Python3中遇到語法錯誤,我不確定如何更正它。我在做什麼語法錯誤?

File "assign1.py", line 24 
    print(chr(code)) 
     ^
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)) 
+0

你可以發表你的錯誤跟蹤? – levi 2015-02-06 02:27:58

+0

你碰到什麼語法錯誤? – Bactos 2015-02-06 02:28:21

+0

在它之前的行上缺少右括號。 – jonhopkins 2015-02-06 02:29:19

回答

1

你只是缺少一個右parethensis,又名),在下面的句子:

number = number - (code << (6 * 1) 
+1

懂了謝謝:) – 2015-02-06 02:36:05