Python print statement “Syntax Error: invalid syntax”
本问题已经有最佳答案,请猛点这里访问。
为什么Python在第9行的简单
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import hashlib, sys m = hashlib.md5() hash ="" hash_file = raw_input("What is the file name in which the hash resides? ") wordlist = raw_input("What is your wordlist? (Enter the file name) ") try: hashdocument = open(hash_file,"r") except IOError: print"Invalid file." # Syntax error: invalid syntax raw_input() sys.exit() else: hash = hashdocument.readline() hash = hash.replace(" ","") |
Python的版本是:
1 2 | Python 3.2.2 (default, Sep 4 2011, 09:07:29) [MSC v.1500 64 bit (AMD64)] on win 32 |
在Python 3中,print是一个函数,你需要像
使用
在Python 3中,
要在Python3中显示字符串内容,必须使用此