Question

word_data : {'alice': ['between', 'cushion', 'pumpkin', 'resting', 'sitting', 'suppose', 'talking', 'testing', 'thought', 'witches'], 'jeeves': ['amazing', 'causing',...

word_data : {'alice': ['between', 'cushion', 'pumpkin', 'resting', 'sitting', 'suppose', 'talking', 'testing', 'thought', 'witches'], 'jeeves': ['amazing', 'causing', 'exactly', 'fellows', 'lantern', 'minutes', 'morning', 'pumpkin', 'respect', 'spilled', 'testing'], 'peterpan': ['corners', 'lantern', 'morning', 'sighted', 'testing', 'witches'], 'sherlock': ['actions', 'drawing', 'dubious', 'emotion', 'himself', 'lantern', 'machine', 'mention', 'motives', 'perfect', 'precise', 'pumpkin', 'results', 'testing', 'trained'], 'tomsawyer': ['lantern', 'moments', 'spirits', 'started', 'testing', 'witches', 'without']}

Python Please

some words are unique in each (key or passage) and some are common, the program should figure out unique word only:

The program should compute and display:  

The count of words unique to each passage

Note: define function is not allowed.

The output for this dictionary should look like this

# Words unique to each passage:
       alice :  7
      jeeves :  7
    peterpan :  2
    sherlock : 12
   tomsawyer :  4
0 0
Add a comment Improve this question Transcribed image text
Answer #1

The answer to this question mainly involves in three steps
1.''' separating the key and value in two different lists values in f and keys in o'''
2.'''finding the unique words from the entire passage''' by using the collection module and counters
3.'''for each word in the value for the particular key we are checking the word is present in the unique words'''

the ouput is as follows:

Add a comment
Know the answer?
Add Answer to:
word_data : {'alice': ['between', 'cushion', 'pumpkin', 'resting', 'sitting', 'suppose', 'talking', 'testing', 'thought', 'witches'], 'jeeves': ['amazing', 'causing',...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT