Question: BlockPy: #40.2) Word Frequency Create a function count_words that consumes a string of comma-separated words and returns the number of occurrences of each word as
BlockPy: #40.2) Word Frequency
Create a function count_words that consumes a string of comma-separated words and returns the number of occurrences of each word as a dictionary. Use the Dictionary Counting pattern and the split method. Make sure you try calling your function to test it out!
BlockPy: #40.5) Mapping Classes
Create a lookup table below that maps your courses (represented by the department code and course number, like "CS1064") to the percentage of your course-related time that they consume. For example, the key "CS1064"might map to .25. The values of the dictionary should add up to 1. You will not be graded based on the amount of time you dedicate to this class. Use dictionary lookup to print the value associated with the key "CS1064".
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
