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
Elodia [21]
3 years ago
7

How can i complain a rude comment

Computers and Technology
1 answer:
insens350 [35]3 years ago
4 0
You can complain to a rude comment by reporting of or answering, if none works ask a moderator for help.
You might be interested in
Write a function wordcount() that takes the name of a text file as input and prints the number of occurrences of every word in t
o-na [289]

Answer:

I am writing a Python program. Let me know if you want the program in some other programming language.        

import string  #to use string related functions

def wordcount(filename):  # function that takes a text file name as parameter and returns the number of occurrences of every word in file

   file = open(filename, "r")  # open the file in read mode

   wc = dict()  # creates a dictionary

   for sentence in file:  # loop through each line of the file

       sentence = sentence.strip()  #returns the text, removing empty spaces

       sentence=sentence.lower() #converts each line to lowercase to avoid case sensitivity

       sentence = sentence.translate(sentence.maketrans("", "", string.punctuation))  #removes punctuation from every line of the text file

       words = sentence.split(" ")  # split the lines into a list of words

       for word in words:  #loops through each word of the file

           if len(word)>2:  #checks if the length of the word is greater than 2

               if word in wc:  # if the word is already in dictionary

                   wc[word] = wc[word] + 1  #if the word is already present in dict wc then add 1 to the count of that word

               else:  #if the word is not already present

                   wc[word] = 1  # word is added to the wc dict and assign 1 to the count of that word                

   for w in list(wc.keys()):  #prints the list of words and their number of occurrences

       print(w, wc[w])  #prints word: occurrences in key:value format of dict        

wordcount("file.txt") #calls wordcount method and passes name of the file to that method

Explanation:

The program has a function wordcount that takes the name of a text file (filename) as parameter.

open() method is used to open the file in read mode. "r" represents the mode and it means read mode. Then a dictionary is created and named as wc. The first for loop, iterates through each line (sentence) of the text file. strip() method is used to remove extra empty spaces or new line character from each sentence of the file, then each sentence is converted to lower case using lower() method to avoid case sensitivity. Now the words "hello" and "Hello" are treated as the same word.

sentence = sentence.translate(sentence.maketrans("", "", string.punctuation))  statement uses two methods i.e. maketrans() and translate(). maketrans() specifies the punctuation characters that are to be deleted from the sentences and returns a translation table. translate() method uses the table that maketrans() returns in order to replace a character to its mapped character and returns the lines of text file after performing these translations.

Next the split() method is used to break these sentences into a list of words. Second for loop iterates through each word of the text file. As its given to ignore words of length 2 or less, so an IF statement is used to check if the length of word is greater than 2. If this statement evaluates to true then next statement: if word in wc:   is executed which checks if the word is already present in dictionary. If this statement evaluates to true then 1 is added to the count of that word. If the word is not already present  then the word is added to the wc dictionary and 1 s assigned to the count of that word.

Next the words along with their occurrences is printed. The program and its output are attached as screenshot. Since the frankenstein.txt' is not provided so I am using my own text file.

4 0
3 years ago
Question 1 (True/False Worth 3 points)
ANTONII [103]
False because the internet connects with multiple communication networks to exchange information
6 0
2 years ago
What software development model focuses on improving the product in small steps each time through the cycle?
VashaNatasha [74]

The software development model that focuses on improving the product in small steps each time through the cycle is the Waterfall Process model

•

The Waterfall Process model mainly focuses on going step by step to make sure the product improves sufficiently and significantly.

•

•

- Marlon Nunez

6 0
3 years ago
Read 2 more answers
A company has two geographically separate locations that need to connect using a VPN. Which of the following devices must be spe
victus00 [196]

Answer:

The correct answer to the following question will be Option A (Firewall).

Explanation:

  • A network or information system of safety that relies on predetermined security rules that monitors and commands outbound traffic of network or it will be configured specifically to allow VPN to enter the network
  • This usually creates a firewall between a trustworthy internal network, such as the Internet, and the untrustworthy outside network.

The other solutions like B, C and D are not capable of allowing VPN to traffic to a network. Therefore, the correct answer is Option A.

3 0
3 years ago
Programmers use an Integrated Development Environment (IDE) to write software programs, because:
Natali [406]

Answer:

A) It simplifies the process by providing a single user interface for multiple software tools.

Explanation:

6 0
2 years ago
Other questions:
  • 5. Which of the following is a Windows feature that allows you to temporarily store text?
    13·2 answers
  • Any program that allows the user to select an item from a menu should ________ the user's selection.
    7·1 answer
  • What is the left are if a slide in a presentation called
    15·1 answer
  • The entirety of a packet at one layer becoming the payload section at another layer is known as
    8·2 answers
  • PLZ HELP ME! What is a false statement about online time?
    9·1 answer
  • Which is a correctly formatted Python tuple?
    9·1 answer
  • Implement function bin2dec that takes a binary number bin_num as a string argument and prints out the corresponding decimal numb
    9·1 answer
  • Add me on f0rtnite <br> (Tsarbacon)
    9·2 answers
  • WILL GIVE BRAINLIEST!!! Danielle is warehouse supervisor for a large shipping company. Most shipments need to leave the warehous
    7·1 answer
  • In python please:
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!