Skip to content Skip to sidebar Skip to footer

Regexp Automatically Runs On Function Input?

So, I've searched for a while and couldn't find anything, so I've decided to turn to the experts on SO to help me clarify what is going on. I am learning Python and whilst learning

Solution 1:

This function isn't running a regular expression on the input ... It's calling float on the input which is converting the input to a floating point number. The "regular expression" that is there is nothing more than a docstring on the function.

Note that r"this is a string" simply creates a "raw string" which has nothing to do with regex ("\t" is tab whereas r"\t" is the literal characters '\' and 't') .

Post a Comment for "Regexp Automatically Runs On Function Input?"