从字典中调用的字符串是无效的语法? - Python 3

问题描述 投票:0回答:1

一个例子:

TheDictionary = {
     'Churros' : ['Using','Stack','Overflow']
     'Python' : ['A','Coding','Language']
     }

结束名称“Python”的引号显然是无效的语法。救命?

python python-3.x dictionary
1个回答
2
投票

你错过了一个逗号。同样在Python中,Upper Camel案例保留给类名。找到下面的固定代码:

the_dictionary = {
  'Churros' : ['Using','Stack','Overflow'],
  'Python' : ['A','Coding','Language']
}
© www.soinside.com 2019 - 2024. All rights reserved.