Question: Cleaning Data: Let s be a string that contains a sequence of decimal numbers separated by commas, but somehow the data is corrupted and a
Cleaning Data: Let s be a string that contains a sequence of decimal numbers separated by commas, but somehow the data is corrupted and a random * shows up either right after a comma, before a comma, or before the rst term of an integer number. e.g. (that's exempli gratia, latin abbreviation of `for example') s = `1.23,*2.4*, 3.123,*5.1, 8.7*, *7.23, *3.23*'. Write a program that prints the sum of the numbers in the string s. Note, the whitespace is unevenly distributed in the string as well. Do this 2 ways: 1. without using any built in functions or methods associated to the string object but with a for or while loop, and 2. with built in string methods.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
