7 kyu

Remove Unnecessary Characters from Items in List

672 of 673BrianC
Description
Loading description...
Fundamentals
Regular Expressions
Lists
Strings
  • Please sign in or sign up to leave a comment.
  • saudiGuy Avatar

    python new test framework is required. updated in this fork

  • Infuzibil Avatar

    This comment has been hidden.

  • oldcoder Avatar

    description could be better

  • JannikB5825 Avatar

    Thats legit too hard for a 7 kyu im a 5 kyu and even after i hit up google and stackoverflow i didnt get an answer.

  • elevenpix Avatar

    I saved so much time by unlocking this solution... I'm currently 6kyu, however this 7kyu kata was a bit hard for me.

  • RomanBoolean Avatar

    I like this kata :)

  • lkilgoretrout Avatar

    I just did this kata and had a similar solution to those posted(though longer and uglier). It only works for 4 digit prices though. When I ran my solution I came across a bunch of prices with 5 or 3 digits, which messed up my whole algorithm . It was not clear to me that there would be prices of varying length (which make the re pattern more complex and this kata way harder)

  • anter69 Avatar

    It's not explained anywhere why $5.$6.6x.s4 becomes $56.64 and not $5.664 or $5664 or $566.4

    Also, leading zeros don't make much sense (as alread reported earlier)

  • AlexeyYurko Avatar

    Why I'm need to import re if i don't use them?

  • luisho5 Avatar

    Hi, I have a couple of suggestions about this kata:

    • Values like '$0967.24' doesn't make sense if we are talking about quantity, you should consider removing all leading 0s..
    • There are ways of doing this that doesn't require importing 're', as my solution, but if you don't import it then you get an error of "global name 're' is not defined". Otherwise, a very fun kata, I liked it a lot. Regards!
  • Joz Avatar

    that was fun =)

  • suic Avatar

    Hi, the test cases are insufficient:

    1. Issue: IMO remove_char("$12.00$$$...") should be $12.00. This case is neither excluded nor tested. Other examples "$$12.$A12$0", ".A03456$",...
    2. Suggestion: Add random tests.

    Regards,

    suic