Solution pour le fichier Fonctions_Palindrome

# -*- coding: utf-8 -*-
"""
Created on Tue Nov 27 14:50:17 2018

@author: vmahout
"""
import math
def Taille(nombre) :
    if (nombre < 100 or nombre >=1000000):
        nbdigit = -1
    else :
        nbdigit = 3
    
        if (nombre >= 1000):
            nbdigit = nbdigit+ 1
        if (nombre > 10000):
            nbdigit = nbdigit+ 1
        if (nombre > 100000):
            nbdigit = nbdigit+ 1
    return (nbdigit)


def Extract(Nb,digit) :
    Val1 = (Nb+0.01)/(10**(digit))
    #print("V1 :",Val1)
    Val2 = Val1 - math.trunc(Val1)
    #print("V2 :",Val2)
    Val3 = math.trunc(Val2*10)
    #print("V3 :",Val3)
    return (Val3)    
    
def Deux_a_Deux(IsPalin,digit,How) :
        
        digit2 = How - digit + 1
        N1 = Extract(IsPalin,digit) 
        N2 = Extract(IsPalin,digit2)
        return (N1,N2)