Data Conversion Function In Python Def