一个猜数字的小游戏,但是在pycharm中有以下错误,用IDLE打开是没有问题的。请问原因是什么?在#guess number
import random #use import function convert random module
num = random.randint(0,11) #create random int
temp = input ('Please type you guess number: ') #type random str
guess = int (temp) #temp convert to int, if the str is decimal could use int(float(temp)) transfer
while guess != num: #while loop
print ("Sorry! You are wrong.")
temp = input ('Please type the number again: ')
guess = int (temp)
if guess == num:
print ('Amazing!')
else:
if guess > num:
print ("The number is high.")
else :
print ('The number is low.')
print ('Congragulation!')
D:\Anaconda\python.exe "C:/Users/Sky Talk/PycharmProjects/untitled/Key"
File "C:/Users/Sky Talk/PycharmProjects/untitled/Key", line 7
print "dict['name']:",dict['name']
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("dict['name']:",dict['name'])?
Process finished with exit code 1