1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Zielflug [23.3K]
4 years ago
13

Write a program that reads whitespace delimited strings (words) and an integer (freq). Then, the program outputs the strings fro

m words that have a frequency equal to freq in a case insensitive manner. Your specific task is to write a function words Frequency(words, freq), which will return a list of strings (in the order in which they appear in the original list) that have a frequency same as the function parameter freq. The parameter words to the function words Frequency(words, freq) should be a list data structure. If two strings in the list words contain the same sequence of characters but are different case, they are considered the same. For example, we will consider the strings UCONN and uconn to be the same.
Computers and Technology
1 answer:
Lesechka [4]4 years ago
3 0

Answer:

See explaination for the code

Explanation:

def wordsOfFrequency(words, freq):

d = {}

res = []

for i in range(len(words)):

if(words[i].lower() in d):

d[words[i].lower()] = d[words[i].lower()] + 1

else:

d[words[i].lower()] = 1

for word in words:

if d[word.lower()]==freq:

res.append(word)

return res

Note:

First a dictionary is created to keep the count of the lowercase form of each word.

Then, using another for loop, each word count is matched with the freq, if it matches, the word is appended to the result list res.

Finally the res list is appended.

You might be interested in
This diagram shows a number of computing devices connected to the Internet with each line representing a direct connection.
Harman [31]

Answer: C

Explanation: Computing Device A is connected using 3 wires, which all lead to multiple different paths of wires. If you break all the wires off of A, it leaves it with no paths to use. However, if you do this with E, there is 4 differents paths connected to it. Since you need the MINIMUM, the answer would be C.

8 0
4 years ago
What target audience does your product serve?
Natasha_Volkova [10]

Answer:

A target audience is the demographic of people most likely to be interested in your product or service. For example if you own a plumbing company, the target audience is property owners, both commercial and residential.

7 0
3 years ago
Hannah weighs 210 pounds using the English System of measurement. If we convert her weight to the Metric System, she would weigh
tatyana61 [14]

Answer:

Check the explanation

Explanation:

C++ PROGRAM

#include <iostream>

using namespace std;

int main()

{

float pounds;

float kilograms;

cout<<"Please enter the weight in pounds :";

cin>>pounds;

kilograms=pounds*0.454;

cout<<"The weight in Kilogram is:"<<kilograms<<"kilograms";

return 0;

}

Kindly check the attached image below for the code output.

3 0
3 years ago
Select the correct answer.
jenyasd209 [6]
I think it is D
Hope my answer help you?
5 0
3 years ago
A total stranger is trolling jack online. He’s offended and annoyed. How can Jack stop the troll in his or her tracks ?
coldgirl [10]
A troll's main goal is to provoke a reaction from people, so I'd say the best way to stop the troll in his or her tracks would be to log off and not give the troll any satisfaction.

Then again, the troll might see you logging off as a win because he or she made you rage quit, so maybe replying with a quick "no u" to troll the troll before logging off would throw them off. That being said, the long term solution would still be not responding at all. After a while of no reactions the troll would most likely get bored.
8 0
3 years ago
Read 2 more answers
Other questions:
  • In some programming languages, such as C#, Visual Basic, and Java, every class you create is a child of one ultimate base class,
    8·1 answer
  • Danielle, a help desk technician, receives a call from a client. In a panic, he explains that he was using the Internet to resea
    9·1 answer
  • Convert each number into scientific notation.
    6·1 answer
  • If you were an architect planning on building a large scale Municipal complex what type of engineer would you identify as essent
    10·1 answer
  • 1. Tracy is studying to become an esthetician. Give three reasons why she needs to have a thorough
    11·1 answer
  • An alternative to hexadecimal notation for representing bit patterns is dotted decimal notation in which each byte
    11·1 answer
  • ___1. my1st JavaProgram<br> A. valid <br> B. invalid
    13·1 answer
  • Whats worth more in adopt me- A Mega Owl or a Mega Frost Dragon?
    8·2 answers
  • Which of the following makes Super Mario Run unique?
    6·1 answer
  • Which organization provides a free, online html5 validator application to ensure that a webpage's html tags follow the rules for
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!