How to pick one number of an Integer
<p>How can I pick one of the digits from an Integer like: 97723
and choose (for example) the number 2 from that number and check if its an odd or an even number?</p>

<p>Also, can I print only the odd numbers from an Integer directly? (Is there any default function for that already?)</p>

<p>Thanks in advance</p>

<p>2 is the 4th digit.</p>

<p>You can get the digits of a number using this construct.</p>

<pre><code>digits = [int(_) for _ in str(97723)]
</code></pre>

<p>This expression will be <code>true</code> if the 4th digit is even.</p>

<pre><code>digits[3] % 2 == 0
</code></pre>

python python-3.x