Dict object not callable, im using jupyter python 3.7. please suggest | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Dict object not callable, im using jupyter python 3.7. please suggest

Dictionary = dict(zip(word_list,[Len(word) for word in word_list]))

14th Dec 2018, 8:38 AM
sai
5 Answers
+ 4
you probably wrote something like this in your code dict = {} x = dict(a=1) so it should work after you rename it
14th Dec 2018, 12:53 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 4
Is this full code?
14th Dec 2018, 3:11 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 2
sai , quote: "I'm trying to generate a dictionary of words & their lengths from a string" => Is this what you're trying to do? https://code.sololearn.com/ctqK8554k3yh/?ref=app
14th Dec 2018, 6:19 PM
Anna
Anna - avatar
+ 1
thank you Anna it worked
14th Dec 2018, 8:10 PM
sai
0
no I didn't write dict ={}. I just wrote the code same as in my question . even though I'm getting error as not callable . what to do. I'm trying to generate a dictionary of words & their lengths from a string
14th Dec 2018, 3:03 PM
sai