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
Len [333]
4 years ago
6

A file concordance tracks the unique words in a file and their frequencies. Write a program that displays a concordance for a fi

le. The program should output the unique words and their frequencies in alphabetical order. Variations are to track sequences of two words and their frequencies, or n words and their frequencies. Below is an example file along with the program input and output: example.txt
Computers and Technology
1 answer:
neonofarm [45]4 years ago
3 0

Answer:

Python file with appropriate comments given below

Explanation:

#Take the input file name

filename=input('Enter the input file name: ')

#Open the input file

inputFile = open(filename,"r+")

#Define the dictionary.

list={}

#Read and split the file using for loop

for word in inputFile.read().split():

  #Check the word to be or not in file.

  if word not in list:

     list[word] = 1

  #increment by 1

  else:

     list[word] += 1

#Close the file.

inputFile.close();

#print a line

print();

#The word are sorted as per their ASCII value.

fori in sorted(list):

  #print the unique words and their

  #frequencies in alphabetical order.

  print("{0} {1} ".format(i, list[i]));

You might be interested in
You would like to set up on online meeting to communicate with colleagues on a group project. Which of these tools should you su
Elenna [48]
WebEx :))))))))))))))))))))))
8 0
4 years ago
Read 2 more answers
Modifying the column widths usually is done last because other formatting changes may affect the size of data in the cells in th
iren2701 [21]
That statement is True.

Modifying column early will be a waste of time because the data may not be displayed if the width is not suitable. So it best to do this after all the data has been entered

hope this helps
3 0
3 years ago
Reading is the process of transferring data, instructions, and information from memory to a storage medium.
maksim [4K]
True, the computer will read from, say, a blu-ray and then transfer it to your RAM to before writing it to your hard drive and then, through the various other wonders of computers, it can be displayed on your monitor.
8 0
4 years ago
Omar’s teacher has asked him to send her a PDF copy of his presentation via email.
Vadim26 [7]

Answer:

1. Export

2. Create PDF/XPS document

3. Standard

4. Click Publish

Explanation:

I got wrong on edg and found the correct answer

8 0
3 years ago
What is the ribbon used for in word
vitfil [10]

Answer:

the ribbon is a set of toolbar at a top of window in office program designed to help you quickly find a commans that you need to complete a task

Explanation:

what is the ribbon in word

6 0
3 years ago
Other questions:
  • In these ones all your finding is the mean(average).
    14·1 answer
  • Which one of the following terms is defined as the material and surfaces upon which an artist works?
    9·1 answer
  • Introduction to graphic design please help! Define the four terms: design ,art,decoration , and visual literacy. Describe how th
    12·1 answer
  • Divide (10x^3 + 19x^2 + x - 7) by (5x + 2)​
    11·1 answer
  • What hernia repair codes can be reported with add-on code 49568?
    6·1 answer
  • Powerpoint s _____ feature allows you to set the timing for a video clip
    12·1 answer
  • We have the following class:
    6·1 answer
  • To obtain the desired speedup, make sure your new function recursively calls itself no more than once in the body of the method.
    8·1 answer
  • Match the different stages of boot sequence with the order in which they occur.​
    15·2 answers
  • 1. Who was able to complete the puzzle the fastest in Trial 1?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!