I have a string containing a number, starting with x, for example, "x270" or "x9". It always starts with x. I need to get the number.
I'm doing this:
blatz = "x22"
a1 = int(re.search("x(\d+)", blatz).group(1))
This doesn't seem very Pythonic. I would welcome more elegant solutions.