half in writing python code for inteprolation