def Answer():
A = var1.get()
if "." not in A and A.isdigit():
Right1.insert(END,str(A)+"est un entier")
elif "." in A and A.isdigit():
B,C = A.split(".")
Right1.insert(END,str(B)+"est decimal" + str(C)+"est entier")
else :
Right1.insert(END,"ERROR")
That is my function Answer for my thinker. When I enter an Interger(12)
, I see the "Integer(12) est un entier
".
But when I enter a decimal number (12.7
), it prints: ERROR
instead of splitting the number to two part. I should have on my screen: "12 est decimal
" "7 est entier
". Any ideas where I am doing wrong?