Extract a number from a string, after a certain character
<p>Ayyyy, I need some help. I have the following strings, always in "char,num" format:</p>

<pre><code>s = "abcdef,12"
v = "gbhjjj,699"
</code></pre>

<p>I want to get just the digits after the comma, how do I do that without splitting the string with the comma as a delimiter?</p>

<p>I tried <code>s[-2:]</code> and <code>v[-3:]</code> which works, but how do I make it work without knowing the number of digits?</p>

<p>I like <code>.partition()</code> for this kind of thing:</p>

<pre><code>for text in ('gbhjjj,699', 'abcdef,12'):

    x, y, z = text.partition(',')

    number = int(z)

    print(number)
</code></pre>

<p>Unlike <code>.split()</code> it will always return three values.</p>

<p>I'll sometimes do this to emphasize that I don't care about certain values:</p>

<pre><code>_, _, z = text.partition(',')
</code></pre>

python