这是迄今为止的代码:
字典
dic1 = [ 'BUG':'A broken pIEce of code that causes a program to stop functioning' 'string':'A pIEce of text' 'integer':'A whole number' 'float':'A decimal number' 'function':'A block of organized and clean code that performs a task/action' 'Syntax':'A set of rules that says how a program will be coded' ]q = input("What Coding related word do you want defined?")if q in dic1: print(dic1[q])解决方法 你在dict的每个条目末尾都忘了一个逗号. Dicts使用花括号“{…}”
dic1 = { 'BUG':'A broken pIEce of code that causes a program to stop functioning','string':'A pIEce of text','integer':'A whole number','float':'A decimal number','function':'A block of organized and clean code that performs a task/action','Syntax':'A set of rules that says how a program will be coded',}总结
以上是内存溢出为你收集整理的Python – 列表中冒号的语法错误全部内容,希望文章能够帮你解决Python – 列表中冒号的语法错误所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)