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]
3 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]3 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
Please solve this in JAVA<br><br> Please see the attachment
Alina [70]

Answer:

I'm going to do it but you should try these things for yourself or else you won't learn.

Explanation:

-First create a project (I'm using Netbeans 14 and the project is a Maven, but the code should work on any IDE)


-Name the project 'ShoppingCartPrinter' and leave the package name as it is. This is the main class so the main method is gonna be there already.

-Then you will create a second class named 'ItemToPurchase'. So I'll leave the code in the attachment (at the bottom of my answer it's written 'Download txt') or else brainly will think it's some sort of redirection to another websites because of the 'dots' and won't let me post it.






Download txt
3 0
1 year ago
What was your learning target for today
Aleks04 [339]

My learning target for today are the follows :

  1. I learn at least 2 words meaning that I don't know.
  2. I learn coding daily at least 10mins
  3. Some quotes
8 0
3 years ago
Read 2 more answers
2 Write<br>a program to and area of<br>4<br>walls. A = 2h (l+b)​
Zanzabum

Answer:

ADGH AVFH VVBLA FDHLAVRGLBHSRGLHFSgh HGK g gH G avoshhbv so bhsf vhbfsb gfsb gb gh g hhow gw

Explanation:

eehhfhsghOhrrbfghedhchggfgsbbfbhdhfhehyfnfnhhsh

3 0
2 years ago
Write 4 types of viruses , explain them briefly.
wariber [46]

I can help with two.

Web Scripting Virus, A sneaky virus that targets popular websites. What this virus does is overwrite code on a website and insert links that can install malicious software on your device. Web scripting viruses can steal your cookies and use the information to post on your behalf on the infected website.

FILE INFECTOR, targeting executable files (.exe), file infector viruses slow down programs and damage system files when a user runs them.

8 0
2 years ago
Byte pair encoding is a data encoding technique. The encoding algorithm looks for pairs of characters that appear in the string
nika2105 [10]

Answer:

The encoding algorithm looks for pairs of characters that appear in the string more than once and replaces each instance of that pair with a corresponding character that does not appear in the string. ... Byte pair encoding is an example of a lossy transformation because it discards some of the data in the original string.

Explanation:

hope it helps!!

6 0
2 years ago
Other questions:
  • After calling the customer service line of Delta airlines, Francis received an email asking her to fill out customer satisfactio
    9·1 answer
  • Drag the correct type of update to its definition.
    5·1 answer
  • Suppose we eliminate tcp and instead rely exclusively on udp as our only transport layer protocol. ⢠how does this impact opera
    15·1 answer
  • What is the output of the following Java code?int x = 1;do{System.out.print(x + " ");x--;}while (x &gt; 0);System.out.println();
    14·1 answer
  • Egyptian hieroglyphs were part of a writing system used by the ancient Egyptians. What type of graphic design elements did they
    13·1 answer
  • Persuasion is when Someone speaks to crowd about love <br>○True<br>○False​
    10·1 answer
  • Why computer literacy is vital to access in business work
    7·1 answer
  • What is the difference between mutex lock and race condition​
    6·1 answer
  • Setting up a desktop computer for anAutoCADspecialist who needs a minimum of 125 GBram which operating system would be the best
    5·1 answer
  • Computer always produces wrong output true or false<br>​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!