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

More By Author:

Check out these other kata created by BrianC

Stats:

CreatedJan 4, 2017
PublishedJan 4, 2017
Warriors Trained1862
Total Skips50
Total Code Submissions2823
Total Times Completed668
Python Completions667
Total Stars36
% of votes with a positive feedback rating78% of 169
Total "Very Satisfied" Votes112
Total "Somewhat Satisfied" Votes38
Total "Not Satisfied" Votes19
Total Rank Assessments14
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • BrianC Avatar
  • suic Avatar
  • siebenschlaefer Avatar
  • saudiGuy Avatar
Ad