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
Are bops safe for organisations ? State your views on it
seropon [69]

Answer:

Explanation:

Crew members need to remember that blowout prevention equipment is heavy any very unforgiving. Working around BOPs (nippling up or down, ram replacement, etc.) puts workers in a high hazard area. All personnel involved in the operation must be fully alert and knowledgeable in their tasks. All crew members should participate in the Pre-Job Safety meeting. Communications are critical in this operation and all personnel should be aware of the signals to be used.

6 0
4 years ago
Pls help!!!!! I need these questions
g100num [7]

Answer:

online identity for the first one and none of the above for the second one:)

8 0
3 years ago
Read 2 more answers
doubleUp Write a method doubleUp that doubles the size of a list of integers by doubling-up each element in the list. Assume the
Maslowich

Answer:

The solution in Python is as follows:

class myClass:

     def doubleUp(self,myList):

           myList[:0] = myList[::2] = myList[1::2] = myList[:]

       

mylist =  [1, 3, 2, 7]

list = myClass()

list.doubleUp(mylist)

print(mylist)

Explanation:

To create a method in Python, the first step is to create a Class.

This is done in the following line:

class myClass:

Then this line defines the method

     def doubleUp(self,myList):

This line duplicates the elements of the list

           myList[:0] = myList[::2] = myList[1::2] = myList[:]

This defines the list        

mylist =  [1, 3, 2, 7]

This creates an instance of the class

list = myClass()

This passes the list to the doubleUp method

list.doubleUp(mylist)

This prints the duplicated list

print(mylist)

4 0
3 years ago
Which type of cluster does NOT belong? a. Density-based b. Shared-Property c. Prototype-based d. Hierarchical-based
loris [4]

Answer:

b. Prototype-based

Explanation:

In clustering, certain methods are used to identify groups. This identifies groups of similar objects in a multivariate sets of data which is collected from different fields.

Shared-property clusters shares some property.

Hierarchical cluster builds a hierarchy.

Density-based identifies clusters in a data. While the prototype based sents observation to nearest prototype.

4 0
4 years ago
Given a line of text as input, output the number of characters excluding spaces, periods, or commas.
Flauer [41]

Answer:

<em>import java.util.Scanner;</em>

<em>public class ANot {</em>

<em>    public static void main(String[] args) {</em>

<em>        Scanner in = new Scanner(System.in);</em>

<em>        System.out.println("Please enter a string of words");</em>

<em>        String n = in.nextLine();</em>

<em>        int count = 0;</em>

<em>        for (int i=0; i<n.length(); i++){</em>

<em>            if((n.charAt(i) != '.') &&(n.charAt(i) != ',') && (n.charAt(i) != ' ')){</em>

<em>                count++;</em>

<em>            }</em>

<em>        }</em>

<em>        System.out.println(count);</em>

<em>    }</em>

<em>}</em>

Explanation:

  1. Prompt User to input the string and assign to a variable
  2. SET count =0.
  3. Using a for loop iterate over the string
  4.  if((n.charAt(i) != '.') &&(n.charAt(i) != ',') && (n.charAt(i) != ' ')) then count =count +1.
  5.     PRINT count.

7 0
3 years ago
Read 2 more answers
Other questions:
  • The rmdir command (with no options) can only remove empty directories <br> a. True <br> b. False
    14·1 answer
  • An application server is used to communicate between a Web server and an organization's back-end systems.
    6·1 answer
  • True or false word inserts text to the right Of the insertion point
    6·1 answer
  • You have been using the same computer for several years. To extend its service life, you decide to upgrade the processor. You ch
    13·1 answer
  • A problem associated with old drivers is:
    8·1 answer
  • Choose all items that represent characteristics of HTML:
    13·2 answers
  • Select all the lines that have a slope of 5/2
    13·1 answer
  • 1.      To reference a style sheet across multiple HTML pages, how would you define your CSS?​
    15·1 answer
  • PLEASE HELP!!!
    8·1 answer
  • In Qbasic how I type the diference between two numbers?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!