7 kyu
Remove Unnecessary Characters from Items in List
667 of 668BrianC
Description:
You've been given a list that states the daily revenue for each day of the week. Unfortunately, the list has been corrupted and contains extraneous characters. Rather than fix the source of the problem, your boss has asked you to create a program that removes any unneccessary characters and return the corrected list.
The expected characters are digits, ' $ ', and ' . ' All items in the returned list are expected to be strings.
For example:
a1 = ['$5.$6.6x.s4', '{$33ae.5(9', '$29..4e9', '%.$9|4d20', 'A$AA$4r R4.94']
remove_char(a1)
>>> ['$56.64', '$33.59', '$29.49', '$94.20', '$44.94']
Fundamentals
Regular Expressions
Lists
Strings
Similar Kata:
Stats:
Created | Jan 4, 2017 |
Published | Jan 4, 2017 |
Warriors Trained | 1862 |
Total Skips | 50 |
Total Code Submissions | 2823 |
Total Times Completed | 668 |
Python Completions | 667 |
Total Stars | 36 |
% of votes with a positive feedback rating | 78% of 169 |
Total "Very Satisfied" Votes | 112 |
Total "Somewhat Satisfied" Votes | 38 |
Total "Not Satisfied" Votes | 19 |
Total Rank Assessments | 14 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |