Data Conversion Function In Python Syntax For Loop