pythonprint缺少括号_“print”调用中缺少括号

一个猜数字的小游戏,但是在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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值