So my problem is this i have an number like 123 and as the tilte sugests i want the result to be 13.
The problem is that firstly with the method im using im going to get
I mean, if python is where you want the solution just do;
Def pluck_even_digits(N):
str_N = str(abs(N))
for digit in [ 0, 2, 4, 6, 8]:
str_N.replace( str(digit), “”)
Return int(str_N)
It’s python, you are not restricted to just use pure math. Also, this way allows you to easily choose a base that is not 10 and pluck values from the representation in that new base.