經安全檢測,此網站為安全網站,請放心前往原始網址!

Python: create a dictionary with list comprehension - Stack Overflow

I like the python list comprehension syntax. Can it be used to create dictionaries too? For example, by iterating over pairs of keys and values: mydict = {(k,v) for (k,v) in blah blah ...

stackoverflow.com

網址安全性掃描由 google 提供