Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Can someone plz explain what the \ does and why the code without \ will replace any char? Sorry, I am quite new and the regex description is overwhelming for me
exactly
.
I can't edit or delete this solution, please excuse the rudeness of my younger self and stop posting retaliating comments >.<
What the second comment was attempting to say is that unless you just know there should be a \ or google it it's probably impossible to logically come up with the (probably) intended solution, but due to the way it was stated it miscommunicated greatly. Sorry! Also I think I was also frustrated about the fact that this is a trivial programming challenge on a site about algorithmic challenges and that it just serves as filler since it doesn't segway into any of the harder algorithmic challenges.
its all about if you know the function sub or not. I didn't know it, but i knew that here is replace function so i just rewrote it to replace
it is fair. its categorized as literally the easiest type of problem on this website.
to be fair I'm a noob and it only took google search == "re.sub examples"
You are talking too much doing 8ku kata
This comment is hidden because it contains spoiler information about the solution
What is the significance of the ?
it's not best practice. The str constructor is being reemplaced by a literal string :,v
its a language feature, so it's definitly level 8 kata
It was already there in the starter code, so the easiest thing was to just add the backslash as opposed to rewriting the whole thing to use str.replace()
Why bother with
re
?Shit was we supposed to use re, I just looked at it and did it really quick, removed uneccesary re import and used built in replace.