answer.
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]
2 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]2 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
The term load is often used to describe opening a page in a ____. Answer
mote1985 [20]
The answer is b web page
8 0
1 year ago
Write the definition of a class Telephone. The class has no constructors, one instance variable of type String called number, an
balu736 [363]

Answer:

The definition of a class Telephone is given as  

public class Telephone // class telephone

{

String number; // variable  number of type string

static int quantity = 250; // variable  quantity  of type int

static double total = 1565.92;  // variable  total  of type double

}

Explanation:

Following is the description of Statement

  • Create a class "Telephone" by using the keyword class.In that class we declared data member .
  • We declared a variable "number" of type "string" which has no constructor.
  • We declared a variable  "quantity" of type "int" which is a static type variable. The static type variable retains the value during the program execution.
  • We declared a variable  "total" of type "double" which is a static type variable. The static type variable retain the value during the program execution .
5 0
2 years ago
Mile markers appear as _____ green signs.
german

Answer:

A.Big,Rectangular

Explanation:

mile markers are sign on high ways they are green signs they are big and rectangular shape

6 0
2 years ago
Read 2 more answers
3.14 LAB: Simple statistics for Python
Ad libitum [116K]

Answer:

Following are the correct python code to this question:

n1 = float(input('Input first number: '))#input first number  

n2 = float(input('Input second number: '))#input second number  

n3 = float(input('Input third number: '))#input third number  

n4 = float(input('Input fourth number: '))#input fourth number  

average = (n1+n2+n3+n4)/4 #calculate input number average

product = n1*n2*n3*n4 # calculate input number product

print('product: {:.0f}  average: {:.0f}'.format(round(product),round(average))) #print product and average using round function

print('product: {:.3f}  average: {:.3f}'.format(product,average)) #print product and average value

Output:

Please find the attachment.

Explanation:

The description of the above python code can be defined as follows:

  • In the above python program four variable "n1, n2, n3, and n4" is defined, in which we take input from the user end, and in these user inputs we use the float method, that converts all the input value in to float value.
  • In the next step, two variable average and product are defined, that calculate all input numbers product, average, and hold value in its variable.
  • In the last line, the print method is used, which prints its variable value by using a round and format method.

8 0
2 years ago
Write a program to read-in a sequence of integers from the keyboard using scanf(). Your program will determine (a) the largest i
Natali [406]
It’s not letting me answer it
3 0
2 years ago
Other questions:
  • Which statement regarding dialogues in multiplayer games is true? Dialogues are based only on players’ actions.
    7·2 answers
  • How frequently should computers containing ehr information be backed up?
    14·1 answer
  • A good website design combines which of the following elements? (select all that apply) powerful web server hardware components
    9·2 answers
  • Classify the given items as belonging to the public domain or protected by copyright law.
    6·2 answers
  • What are the advantages and disadvantages of using a very large memory cell size, say, W = 64 instead of the standard size W = 8
    15·1 answer
  • A company wants to publish Knowledge articles to its Customer Community. The articles should be organized for easy navigation by
    6·1 answer
  • Write a SELECT statement that selects all of the columns for the catalog view that returns information about foreign keys. How m
    6·1 answer
  • Write an expression to print each price in stock prices.
    15·1 answer
  • What is the average number of nodes accessed in search for a particular element in an unordered list? In an ordered list? In an
    6·1 answer
  • Write a program that takes a single integer input from the user and stores it in a variable. Your program should increase the va
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!