subject

A) join During the last assignment you made a function that echoed a string several times with a separator between each repetition Here we will achieve a similar goal through the use of the joint method of the str dass When Join() is called on a str object (let's call it separator) with a list as its argument, it joins the elements of the list separating each one by Separator Below we define a a list wy_list Use the join() method on the string you define as separator" to join the elements in my list separated by the character Save the output to a new variable called foined_string The output should look as follows: "Python is so much fun! In [ ]: # This variable provided for you my_list - ['Python', 'is', 'o', 'much', 'fun) # YOUR COOE MERE raise Not ImplementedError() In [ ]: assert Isinstance(Joined_string, str) assert joined string -- "Python is so much fun! B) replace Now try to use the replace method to update the string statement such that it replaces UCLA to UCSO If you are unsure how use replace you can run str. replace to look at documentation, Note that using replace retums a new string that you need to assign to a variable if you want to keep a reference to replace is not implace") For this question, overwrite statement as the assignment to the output of the replace call In [ 1 # This code provided for you statement - UCLA is the best UC in Southern California # YOUR CODE HERE raise Not ImplementedError() In [ ]: assert Isinstance(statement, str) assert statement UCSD is the best UC in Southern California."
C) replace for dropping characters Use the replace method to remove all the exclamation polnts in the string excessive Assign the output of doing this to a variable called Fixed Hint, you can drop characters with replace by replacing them with an empty string In [ ]: This variable provided for you excessive - using exclamation point is the best 111111 • YOUR CODE HERE raise NotImplementedError() In [ 1 assert isinstance(fixed, ste) assert fixed using excessive exclamation points is the best!
D) Clearing all punctuation with replace Now we want to generalize what we did in 'cy to remove al punctuation using the replace() method Write a Por loop to loop over every character in string punctuation inside the loop. call replace on too much with the current punctuation character to remove it, like we did in 'cy To do this, inside the loop, re-assign too_much to be the output of calling replace on too much so that you are replacing too much with its updated version every time. In 1: This variable provided for you too much 1, think that punctuation... may be the bes$$$t thing that has ever been invented111111 # YOUR COOE MERE raise Not ImplementedError() In ( 1: assert isinstance(too much, str) assert too much I think that punctuation may be the best thing that has ever been invented

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 07:00
Jean has kept the content of her website limited to what is important; she has also ensured that the text follows a particular style and color all throughout her website. which website features has jean kept in mind? jean has limited the content of her website to what is important; this ensures (clarity, simplicity, harmony and unity) of the content. she has also formatted the text in a particular style and color throughout her website, ensuring (balance, simplicity, consistency)
Answers: 2
question
Computers and Technology, 24.06.2019 14:30
In a home that has 120 v service, there is an electric appliance that has a resistance of 12 ohms. how much power will this appliance consume? a. 10 w b. 120 w c 1200 w d. 1440 w
Answers: 1
question
Computers and Technology, 24.06.2019 21:50
The use of phrases, fragments, and punctuation can influence the mood of a passage; keeping this in mind, how would you describe the mood of the followingpassage? "fog on the essex marshes, fog on the kentish heights, fog creeping into the cabooses of collier-brigs; fog lying out on the yards, and hovering in the riggingof great ships; fog drooping on the gunwales of barges and small boats. fog in the eyes and throats of ancient greenwich pensioners, wheezing by thefiresides of their wards; fog in the stem and bowl of the afternoon pipe of the wrathful skipper; fog cruelly pinching the toes and fingers of his shivering little'prentice boy on deck." (5 points)
Answers: 2
question
Computers and Technology, 25.06.2019 07:50
The “tab” key can a. create extra cells in a word table *b. move from cell to cell in a word table c. move from the top of a column to the bottom of a column in a word table d. none of the above a. none of these answers are correct b. move from cell to cell in a word table c. move from the top of a column to the bottom of a column in a word table d. create extra cells in a word table
Answers: 2
You know the right answer?
A) join During the last assignment you made a function that echoed a string several times with a sep...
Questions
question
Mathematics, 12.03.2021 08:40
question
Mathematics, 12.03.2021 08:40
Questions on the website: 13722360