Uncategorized

[python] list to dict

# List of stringslistOfStr = [“hello”, “at” , “test” , “this” , “here” , “now” ]

dictOfWords = { i : 5 for i in listOfStr }

hello :: 5

here :: 5

this :: 5

test :: 5

at :: 5

now :: 5