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
Nana76 [90]
3 years ago
10

Write a program that reads a list of words. Then, the program outputs those words and their frequencies. Ex: If the input is: he

y hi Mark hi mark the output is: hey 1 hi 2 Mark 1 hi 2 mark 1
Computers and Technology
1 answer:
Tpy6a [65]3 years ago
4 0

Answer:

#Declare variable to get the input

#list from the user

input_list = input()

#split the list into words by space

list = input_list.split()

#Begin for-loop to iterate each word

#to get the word frequency

for word in list:

#get the frequency for each word

frequency=list.count(word)

#print word and frequency

print(word,frequency)

Explanation:

This program that we are told to write will be done by using python programming language/ High-level programming language.

The question wants us to write a program in which the output will be as below;

hey 1

hi 2

Mark 1

hi 2

mark 1

Just by imputing hey hi mark hi mark.

Just copy and run the code below.

#Declare variable to get the input

#list from the user

input_list = input()

#split the list into words by space

list = input_list.split()

#Begin for-loop to iterate each word

#to get the word frequency

for word in list:

#get the frequency for each word

frequency=list.count(word)

#print word and frequency

print(word,frequency)

You might be interested in
Because of the internet, travel agents now focus more on computers than they do on customer relationships.
jasenka [17]

Answer:

true

Explanation:

there are a lot of easier ways to access clients through computers with the internet.

6 0
2 years ago
Read 2 more answers
#Create a class called Name. Name should have two attributes
prisoha [69]

Answer:

//class Name

class Name {

// attributes gave you 3

String first_name;

String last_name;

int length = 0;

//constructor with 2 parameters

Name(String first_name, String last_name){

}

//methods

public String find_printed_name(){

return first_name + " " + last_name;

}

public void find_sortable_name(){

return last_name + ", " first_name.charAt(0);

}

public static void main(String[] args){

// instantiate the class

Name test_name = new Name("David", "Joyner");

System.out.println(test_name.first_name);

System.out.println(test_name.last_name);

System.out.println(test_name.find_printed_name());

System.out.println(test_name.find_sortable_name());

}

Explanation:

You didn't specify a language so I did it in Java.

You should know how to declare methods in Python.

3 0
3 years ago
Which type of operating system is usually used in personal computers?
joja [24]

Answer:

Microsoft Windows

Explanation:

7 0
3 years ago
Read 2 more answers
"Consider the following code snippet: int number = 0; Scanner in = new Scanner(System.in); System.out.print(""Enter a number: ""
Bad White [126]

Answer:

if (number > 30) {. . .}

Explanation:

This code block uses a simple if-elseif-else control structure to do a comparison on a value.  In this type of control structure, each operation of control is check until the correct condition is met, and once the code executes, it exits the control structure, never touching the remainder of the structure.

In this example, we are fortunate that the value triggers the first part of the control structure with if (number > 30) and will execute that section of code.  Once the code finishes, it will exit the structure, never making it to the other 3 control conditions.

Cheers.

3 0
3 years ago
What is often called the brain of a computer
Nookie1986 [14]

Answer:

Explanation:

The computer brain is a microprocessor called the central processing unit (CPU)

6 0
3 years ago
Other questions:
  • Consider the following method.
    13·1 answer
  • rob just got a new idea for the movie he's making, and he wants to put in late hours to get it done. Which of the following stat
    10·1 answer
  • _______ view focuses on the text and content of a document, without much information on the page layout.
    7·1 answer
  • Is there a way I can put an already made sound that i created over an already made video
    6·1 answer
  • IF YOU COULD CREATE A SOCIAL NETWORK:, what would it be like? What would make it so special about the others? (If you want you c
    9·1 answer
  • Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
    11·1 answer
  • The cameras picture review function allows you to look at the _ you've taken
    8·1 answer
  • Display the Approval Form worksheet and create an IF statement in cell B13 to determine if the applicant is eligible for a perso
    7·1 answer
  • During the ___ phase of a software development project, members broadly define the features that the software should include
    15·1 answer
  • charles, a security analyst, needs to check his network for vulnerabilities. he wants a scan that interacts with network nodes a
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!