Python:raw_input和模板字符串语法错误

时间:2019-01-19 13:38:10

标签: python-2.7 syntax-error

我有以下代码行:

league = 'something'    
wherel = raw_input('NEW LEAGUE - %s - insert 1 to put in good leagues, insert 2 to put in bad leagues ', % league)

其中似乎有一个sintax错误。

我确实检查了这个答案:

Python: Can you use raw_input and template strings? (%s)

它应该可以工作,但是我真的不知道出什么问题了。

1 个答案:

答案 0 :(得分:0)

raw_input中有一个,

league = 'something'    
wherel = raw_input('NEW LEAGUE - %s - insert 1 to put in good leagues, insert 2 to put in bad leagues ', % league)

ref:String Formatting