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
How do u type faster
eduard

Answer:

by learning the right home keys and how to place the fingers

Explanation:

the left hand side : A,S,D,F

the right hand side: :, L, K, J

the two little fingers are guide keys

guide keys: letter A and column

5 0
3 years ago
Which is a benefit of getting information from a government website?
Leto [7]

The benefit of getting information from a government website is that the information can be trusted. Government wouldn't post just about anything on its website - if it wants to share something on its webpage, it has to be a correct and reliable information, and something that you definitely can trust. No other website can guarantee that the way government websites can.

7 0
3 years ago
Read 2 more answers
Suppose you are working as an administrative assistant at a small law firm. Your boss has asked you to send an invitation out to
storchak [24]

Answer:

PDF

Explanation:

Just did the assignment egde 2021

6 0
2 years ago
Pendant Publishing edits multi-volume manuscripts for many authors. For each volume, they want a label that contains the author'
lbvjy [14]

Answer:

Check the explanation

Explanation:

Pseudocode For Reading File:

start

Declarations

InputFIle records.txt

OutputFile result.txt

string authorName

string title

int numOfVol

open InputFile

open OutputFile

input authorName, title, numOfVol from records.txt

while not eof

output authorName

output title

output numOfVol

end while

close records.txt

close results.txt

END

The flowchart for reading the file can be seen below.

3 0
3 years ago
Program 3.Study the code carefully and write out the line where there is error, debug it and write out the correct code
stich3 [128]

Answer:

Several errors:

  • 0 where ( ) was intended (probably OCR problem)
  • space between As and Double
  • Single quote in stead of double quote in text string
  • $ in stead of & near Math.sqrt
  • missing spaces around "is" for proper formatting

5 0
3 years ago
Other questions:
  • What type of Windows Server is the most likely server to be targeted by a computer hacker?
    13·2 answers
  • Each organization that provides host services on the public Internet is responsible for providing and maintaining DNS authoritat
    7·1 answer
  • convert the following c code to mips. assume the address of base array is associated with $s0, n is associated with $s1, positio
    14·1 answer
  • Mr. Green maintains a spreadsheet containing data on all of his employees, including name, job profile, monthly salary, and home
    15·1 answer
  • Write the definition of a function named printstarbucks that receives a non-negative integer n and prints a line consisting of n
    6·1 answer
  • The advent of optical discs was made possible by developments in ____ technology.
    5·1 answer
  • Is 5g harmful to the body ?
    9·2 answers
  • Which of the following statements accurately describes linked data?
    5·1 answer
  • HELP PLEASE !!!!!!!!!!!! Amy needs to ensure that she can enter a parameter that will match the values End, deadend, and flatend
    8·1 answer
  • To optimize the flow of data into and out of the cpu, the modern mcc provides at least _______________ of data every time the cp
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!