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>

<pre><code># choose a digit (by index)

integer = 97723

digit_3 = str(integer)[3]

print(digit_3)

# check if even:

if int(digit_3) % 2 == 0:
    print(digit_3, "is even")


# get all odd numbers directly

odd_digits = [digit for digit in str(integer) if int(digit) % 2 == 1]

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

python python-3.x