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
myrzilka [38]
3 years ago
9

To start, define a function called strip_punctuation which takes one parameter, a string which represents a word, and removes ch

aracters considered punctuation from everywhere in the word. (Hint: remember the .replace() method for strings.)
Computers and Technology
1 answer:
soldi70 [24.7K]3 years ago
8 0

Answer:

The code is given below. The punctuation_chars variable contains a list of punctuation to be replaced by the program

Explanation:

def strip_punctuation(word):

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

   for ch in punctuation_chars:

       word = word.replace(ch, '')

   return word

# Testing the function here. ignore/remove the code below if not required

print(strip_punctuation("Hello, how are you. I am good! ,.!#@"))

<u>OUTPUT</u>

Hello how are you I am good

You might be interested in
By Definition, a Small Business?
Strike441 [17]

Answer:

A small business is a privately owned and operated business. A small business typically has a small number of employees.

Hope this helped you!

Explanation:

4 0
3 years ago
You are given a string of n characters s[1 : : : n], which you believe to be a corrupted text document in which all punctuation
alexdok [17]

Answer: provided in the explanation section

Explanation:

Given that:

Assume D(k) =║ true it is [1 : : : k] is valid sequence  words or false otherwise

  • To determine D(n)

now the sub problem s[1 : : : k] is a valid sequence of words IFF s[1 : : : 1] is a valid sequence of words and s[ 1 + 1 : : : k] is valid word.

So, from here we have that D(k) is given by the following recorance relation:

D(k) = ║ false maximum (d[l]∧DICT(s[1 + 1 : : : k]) otherwise

Algorithm:

Valid sentence (s,k)

D [1 : : : k]             ∦ array of boolean variable.

for a ← 1 to m

do ;

d(0) ← false

for b ← 0 to a - j

for b ← 0 to a - j

do;

if D[b] ∧ DICT s([b + 1 : : : a])

d (a) ← True

(b). Algorithm Output

      if D[k] = = True

stack = temp stack           ∦stack is used to print the strings in order

c = k

while C > 0

stack push (s [w(c)] : : : C] // w(p) is the position in s[1 : : : k] of the valid world at // position c

P = W (p) - 1

output stack

= 0 =

cheers i hope this helps !!!

8 0
4 years ago
When you open a browser window, it open in a _____. <br> a. fieldb. folderc. menud. window?
Romashka [77]
D. A window the rest are incorrect
4 0
4 years ago
Which contact field is used to control the name that would appear in the To field of an email message when a user is sending a m
ser-zykov [4K]

Answer:

Display as

Explanation:

Need the same question, but that's my guess, because display, means to show.

3 0
3 years ago
Read 2 more answers
What effect does social media have on teens?
myrzilka [38]

Answer:

manipulation is the answer

3 0
3 years ago
Read 2 more answers
Other questions:
  • The number of credits awarded for the CLEP exam is determined by__<br> Help pls!
    15·1 answer
  • Your school computer library has a network that connects computers and devices within a few small rooms. what type of network do
    7·1 answer
  • Displays are geared for a specific resolution. what is this resolution called?
    15·1 answer
  • What is the name of the file manager in Microsoft Windows. The file manager used in Microsoft Windows is?
    12·2 answers
  • Which cell formatting is most likely to use $?
    5·1 answer
  • What is Automation ? Please give an example ?
    14·1 answer
  • Whats the formatting of a letter to the editor?​
    12·1 answer
  • Lily obtained data from five trails 50 kcal 72 kcal 12 kcal and 50 kcal which best decribes her data
    11·1 answer
  • • Use variable to create the number 0 at location 0, 400.
    11·1 answer
  • 2. What are some other reasons why you might need to know the operating system version on your computer or mobile device
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!