Question: 1. Write a Python program that can find and perform string slicing to extract the portion of the string after the colon character and
1. Write a Python program that can find and perform string slicing to extract the portion of the string after the colon character and then use the float function to convert the extracted string into a floating-point number. String is as follows: str_for_901 = 'X-DSPAM-Confidence:0.8475' 2. Write a Python program to split a given string using the delimiter as hyphens and display each resulting substring as a list. Use the string 'Emily-is-a-data-scientist-who-works-at- google-and-previously-facebook'. 3. Write a Python program to find value 19 in the list, and if it is present, replace it with 199. Only update the first occurrence of an item. And sum the resulting list. list_for_902= [51, 1, 15, 19, 25, 50, 19] 4. Using the above list given in the question 3, write a Python program to remove both the entries of 19. To achieve this solution, define a function called removeEntry() and use for loop inside this function. 5. Write a Python program to extend the mainList by adding the second List the extend method. mainList=["n", "b", ["c", ["d", "e", ["n", "o"], "i"], "s"], "q", "y"] second List=["g", "k", "j"] Expected output list looks something like the following: ["n", "b", ["c", ["d", "e", ["n", "o", "g", "k", "j"], "i"], "s"], "q", "y"]. Indexing hint: mainList[2] = ['c', ['d', 'e', ['n', 'o'], 'i'], 's'] mainList [2][1] = ['d', 'e', ['n', 'o'], ''] mainList [2][1][2] = ['n', 'o']
Step by Step Solution
There are 3 Steps involved in it
Sure lets tackle each question one by one 1 To extract the floatingpoint number from the given strin... View full answer
Get step-by-step solutions from verified subject matter experts
