Python Program to convert int to string (Using the .format() function)

bookmark

n = 10  
  
# check  and print type of num variable  
print(type(n))  
  
# convert the num into string and print  
con_n = "{}".format(n)  
print(type(con_n))  


Output:

<class 'int'>
<class 'str'>