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]
3 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]3 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
Define print_shape() to print the below shape. Example output:
ella [17]

The print_shape() is an illustration of Python function; whose execution is carried out when the function is called

<h3>The print_shape() function</h3>

The print_shape() function written in Python, where comments are used to explain each action is as follows:

#This defines the function

def print_shape():

   #The following iteration is repeated three times

   for i in range(3):

       #This prints the *** in each iteration

       print('***')

#This calls the function

print_shape()

Read more about Python functions at:

brainly.com/question/15745784

5 0
2 years ago
Write the definition of a method twice, which receives an integer parameter and returns an integer that is twice the value of th
Kipish [7]
<span>public static int methodName(int a, int b){
      a = a * 2;
      b = b * 2;
}
</span><span>int result = doubling(5, 10<span>);
System.out.println(result);
//result would be 10, 20</span></span>
5 0
3 years ago
Write a statement that declares a prototype for a function printArray, which has two parameters. The first parameter is an array
Savatey [412]

Answer:

void printArray(int [],int);

Hope this helps!

4 0
3 years ago
List and describe the three types of cloud models described by Microsoft.
anygoal [31]

There are three main service models of cloud computing – Infrastructure as a Service (IaaS), Platform as a Service (PaaS) and Software as a Service (SaaS). There are clear differences between the three and what they can offer a business in terms of storage and resource pooling, but they can also interact with each other to form one comprehensive model of cloud computing.

aaS (Infrastructure as Service)

This is the most common service model of cloud computing as it offers the fundamental infrastructure of virtual servers, network, operating systems and data storage drives. It allows for the flexibility, reliability and scalability that many businesses seek with the cloud, and removes the need for hardware in the office. This makes it ideal for small and medium sized organisations looking for a cost-effective IT solution to support business growth. IaaS is a fully outsourced pay-for-use service and is available as a public, private or hybrid infrastructure.

PaaS (Platform-as-a-Service)

This is where cloud computing providers deploy the infrastructure and software framework, but businesses can develop and run their own applications. Web applications can be created quickly and easily via PaaS, and the service is flexible and robust enough to support them. PaaS solutions are scalable and ideal for business environments where multiple developers are working on a single project. It is also handy for situations where an existing data source (such as CRM tool) needs to be leveraged.

SaaS (Software as a Service)

This cloud computing solution involves the deployment of software over the internet to variousbusinesses who pay via subscription or a pay-per-use model. It is a valuable tool for CRM and for applications that need a lot of web or mobile access – such as mobile sales management software. SaaS is managed from a central location so businesses don’t have to worry about maintaining it themselves, and is ideal for short-term projects.

3 0
3 years ago
Which intel processor technology interconnects the processor, chipset, and wireless network adapter as a unit, improving laptop
Ira Lisetskai [31]
Apu?
....................
8 0
3 years ago
Other questions:
  • Keeping in mind the role the order of precedence plays in equations, what would Excel display as the result of the following equ
    15·1 answer
  • Which of the following is the correct code to link the text "Sunny Days" to the website www.sunnysunshine.com?
    15·1 answer
  • Ivy is a student. She is looking for some freelance assignments during her vacation. Which of the following networking sites can
    9·1 answer
  • HELP 11 pointsw to the person who helps me
    11·2 answers
  • A(n) _________ is a computer system which is part of a larger system which performs a dedicated function.
    8·1 answer
  • E-mail messages, instant messages (IMs), or text messages sent and/or received within an organization a. are not included on a r
    9·1 answer
  • Questions Presscomion
    9·1 answer
  • What are some other ways to program a robot to navigate a complicated environment other than straight paths and right angle (90
    15·1 answer
  • Some programmers include scroll bars, title bars, buttons, and menus in a program simply by adding them to a layout through a pr
    10·1 answer
  • Develop a command sequence would you use to alter the amount of space between the text in a text box and the text box border?.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!