Nevermind.. I got the answer. Though I don't know if this is the best way to do it.
Apparently '%' operator can't deal with floats so to get the decimal part only I used this:
answer = somefloat - int(somefloat)
By using int(), it automatically gets rid of the decimal part so when you subtract it to the ones with a decimal value, you could get rid of the integer part.