Write a function frequency_match(text, chars) that receives a string text and a dictionary chars that has characters as keys and numbers as values. The function must return a list with all the characters that occur in the text as many times as their associated value in the char dictionary.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter10: Pointers
Section: Chapter Questions
Problem 2PP
icon
Related questions
Question

(Difficulty Level 3)
Write a function frequency_match(text, chars) that receives a string text and a dictionary chars that has characters as keys and numbers as values. The function must return a list with all the characters that occur in the text as many times as their associated value in the char dictionary.

Not all the chars in the text will be present in the dictionary, but you may assume that all the chars in the dictionary are in the text. You are allowed to change the values in the dictionary.

solve using python 

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr