Question: This is a python 3 program: I have this program where it opens a file and creates a list of each line and then creates

This is a python 3 program:

I have this program where it opens a file and creates a list of each line and then creates a dictionary where the first index of each line are the key and the rest would be the values. What im having issues is that theres a user input where they ask for a key and it print the values of the key. This is what I have so far:

This is a python 3 program: I have this program where it

and here is the text tfile that im using.

opens a file and creates a list of each line and then

def reads fileO: file- input('enter a file: ') f- open(file).readlinesC word_list- for words in f: word_list.append(words.splitO) #return word-list #def creat-dict(word-list): rhyme_words- rhyme_words-fitems [0]: items [1:] for items in word_list 1 #return rhyme, words #def choose-Word(rhyme-Words): word_selcted- inputC'select word to rhyme: if word_selcted in rhyme_words

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!