Python:应为:<NEWLINE>

2024-10-01 11:42:00 发布

您现在位置:Python中文网/ 问答频道 /正文

我写的

 # -*- coding: utf-8 -*- 

    def ANdata(key, id, format, nR, start) :
        queryUrl = 'http://developer.website.com/api/v4/type/news?api_key=' + key + '&id=' + id + '&format=' + format + '&results=' + nR + '&start=' + start
        print "test"

错误是:

^{pr2}$

你看到问题了吗?在


Tags: keycomapiidformathttpdeveloperdef
2条回答

在python3中,print从关键字改为函数。所以要使用它,你必须把它的参数放在括号里:

print("test")

在python2.x中,它可以使用圆括号,也可以不使用圆括号。在

我还是不知道2.3亩的问题。 但我在改为2.7版本后修复了这个问题。在

相关问题 更多 >