python function to convert to string code example Example 1: how to convert to string in python str(integer_value) Example 2: to string python x = 2.718 strX = str(x)