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
sergey [27]
3 years ago
9

Define a function called strip_punctuation which takes one parameter, a string which represents a word, and removes characters c

onsidered punctuation from everywhere in the word. (Hint: remember the .replace() method for strings.)punctuation_chars = ["'", '"', ",", ".", "!", ":", ";", '#', '@']
Computers and Technology
1 answer:
DaniilM [7]3 years ago
8 0

Answer:

punctuation_chars = ["'", '"', ",", ".", "!", ":", ";", '#', '@']

def strip_punctuation(strWord):

   for charPunct in punctuation_chars:

       strWord = strWord.replace(charPunct, "")

   return strWord

Explanation:

The function is defined with a single argument.

A for loop is ran to check each character of the the word.

If a punction mark is present as a character in the word, it is removed.

The same word is returned but without the punctuation marks.

You might be interested in
In an oblique drawing, which lines can be measured accurately, if there is no foreshortening?
Gwar [14]
The correct answer is a i did this before you all

6 0
3 years ago
Implement the function calcWordFrequencies() that uses a single prompt to read a list of words (separated by spaces). Then, the
Novosadov [1.4K]

Answer:

JavaScript code is given below

Explanation:

function calcWordFrequencies() {

   var words = prompt("Enter the sentence below").split(" ");

   var unique_words = [], freqencies = [], count = 0;

   for (var i = 0; i < words.length; i++) {

       var found = false;

       for (var j = 0; j < count; j++) {

           if (words[i] === unique_words[j]) {

               freqencies[j] = freqencies[j] + 1;

               found = true;

           }

       }

       if (!found) {

           unique_words[count] = words[i];

           freqencies[count] = 1;

           count++;

       }

   }

   for (var i = 0; i < words.length; i++) {

       var result = 0;

       for (var j = 0; j < count; j++) {

           if (words[i] === unique_words[j]) {

               result = freqencies[j];

               break;

           }

       }

       console.log(words[i] + " " + result);

   }

}

5 0
3 years ago
After adjusting your seat, your _____ should be as close as possible to the backrest
Dvinal [7]
It should be “back” your back is a very important part of your body and needs something to rest on
4 0
3 years ago
Read 2 more answers
. What may happen if a large number of computer users are attempting to access a Web site at the same
MatroZZZ [7]
B. you may be unable to link to the site.
If the site uses cookies, then there might be a site overload. 
6 0
3 years ago
Read 2 more answers
50 points!!!!!
prohojiy [21]
I would say a. correcting others' spelling and grammar.
3 0
3 years ago
Read 2 more answers
Other questions:
  • Code the function (insertNth list N insValue) which constructs a new list by inserting the specified insValue into the list afte
    6·1 answer
  • If you have a long title for a table and need it to span several cells, you can use A. Merge Cells. B. Split Cells. C. Insert Co
    5·1 answer
  • Where can you find your EFC
    8·2 answers
  • dam is writing a program that: 1) has the user guess a number, and 2) tells the user how many guesses it took to get the correct
    9·1 answer
  • There are....... section in<br>cpu<br>​
    15·1 answer
  • WILL MARK CORRECT ANSWER AS BRAINLIEST PLSSSS HELP!
    13·2 answers
  • What is the difference between an activity inventory and an object inventory?
    8·1 answer
  • Que ventajas podria traer el internet a la educacion artistica? Ayuda porfa telo pido porfavor
    13·1 answer
  • What product use programmable control?
    11·1 answer
  • what is one benefit of placing voip gateways in geographically separated branch offices that have an existing wan connection?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!