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
weeeeeb [17]
4 years ago
15

Here's something to stop you from getting repetitive when writing essays. Write a program that reads multiple lines of plain tex

t from the user, then prints out each different word in the input with a count of how many times that word occurs. Don't worry about punctuation or case – the input will just be words, all in lower case. Your output should list the words in alphabetical order.

Computers and Technology
1 answer:
Marianna [84]4 years ago
7 0

Answer:

The output is attached below

Explanation:

d = {}

while True:

line = input("Enter line: ")

if len(line)==0:

break

token = line.split(' ')

for var in token:

try:

if len(var)==0:

continue

count = d[var]

d[var] = count + 1

except KeyError:

d[var] = 1

pass

for word in sorted(d):

print(word , d[word])

------------------

You might be interested in
The term that refers to the standard computer language for creating web pages is called:
Pavel [41]

Answer:

Language programming Web's programming language

Explanation:

6 0
4 years ago
Choose the comparison operator that will create a true statement in Scratch
andrew11 [14]

Answer:

The second option

90 > 85

The statement above means 90 is more than 85 which is true.

7 0
2 years ago
Write a function that takes an integer and reverses the digits. The function returns the reversed number to main. Here is the pr
laila [671]

Answer:

The prototype part missing has been assumed to be:

int reverseNum (int num);

Code:

#include <iostream>

using namespace std;

int reverseNum(int num);

int main()

{

int num=0,result=0;

cout<<"Enter the number:";

cin>>num;

result=reverseNum(num);

cout<<"The reversed number :"<<result<<endl;

return 0;

}

int reverseNum(int num)

{

int temp=0,digit=0;

for(num;num>0;num=num/10)

{

digit=num%10;

temp=temp*10+digit;

}

return temp;

}

Explanation:

5 0
3 years ago
What educational site could I make a screen capture tutorial on? I need ideas for a school project.
snow_tiger [21]

You Need Software To Screen Capture

The Software You can use is OBS its free and there are watermarks

4 0
3 years ago
Which of these port transmits digital video
DaniilM [7]

Answer:

uhm

Explanation:

theres nothing there

7 0
3 years ago
Read 2 more answers
Other questions:
  • In pre-shared key mode, a passphrase should be at least ________ characters long.
    15·1 answer
  • Write a recursive method to compute the following series: 1 + 1/2 + 1/3 + 1/i ... Write a test program that displays m(i) for i
    14·1 answer
  • In this assignment, you will write a complete C program that will act as a simplecommand-line interpreter (i.e., a shell) for th
    12·1 answer
  • You have a desktop computer that supports both IEEE 1394 and USB 2.0. You are purchasing some devices that will connect to these
    13·1 answer
  • Read the excerpt from The Code Book. Other attacks include the use of viruses and Trojan horses. Eve might design a virus that i
    13·1 answer
  • An administrator wants to configure hosts to automatically assign IPv6 addresses to themselves by the use of Router Advertisemen
    14·1 answer
  • C. An error that due to wrong input.​
    13·1 answer
  • Write ONE SQL statement for each of the following tasks. Note that you can only use conditions specified in the task description
    5·1 answer
  • Complete the sentence.
    10·1 answer
  • How do you delete questions you asked?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!