python - opening and implementing a txt file into a Dictionary -


i having problems following lines of code:

    dictionary = {}     open("text docs/clues.txt", "r") l:         l in clues:             dictionary[l[0]] = dictionary[l[1]] 

getting error says:

(file location), line #, in function l in clues: nameerror: global name 'clues' not defined 

you not iterating on file object, meant:

dictionary = {} open("text docs/clues.txt", "r") l:     line in l:         ... 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -