0
我看到下面的错误:“非ASCII字符”错误时,从Windows PowerShell中运行的Python程序
SyntaxError: Non-ASCII character '\x93' in file new2.py on line 2, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
当我运行这段代码:
print(“Welcome")
guess = 0
while guess != 5:
g = input(“Guess the number: ")
guess = int(g)
if guess == 5:
print(“You win!")
else:
if guess > 5:
print(“Too high")
else:
print(“Too low")
print(“Game over!")
''''应该是什么符号?在'g = input(“猜测数字:”)'这一行' - 与你的'print'语句相同 – UnholySheep
你的引语是正确的'''但是你的开头引号都是* smart引号*,而不是ascii。你是否从其他应用程序中复制并粘贴了这些内容,这可能是你错误的原因。 –