Django Python Dictionary comprehension giving syntax error

后端 未结 1 2011
太阳男子
太阳男子 2021-01-29 05:45

I was using dictionary comprehension in my Django app (tried in django shell as well) but is giving a syntax error. Here is a sample code.

>>> first_dic         


        
1条回答
  •  再見小時候
    2021-01-29 06:00

    Dictionary comprehensions are only in Python versions 2.7+, and it seems you are running Django under an earlier version.

    0 讨论(0)
提交回复
热议问题