Posted on 20th April 2024
Let us see the two different methods by which an integer type can be converted into the string type
Method 1:
Use str()
numb = 30
print(type(numb))
converted_numb = str(numb)
print(type(converted_numb))
Output:
<class ’int’>
<class ‘str’>
Method 2:
Use the “%s” keyword
numb = 40
print(type(numb))
"% s" % numb
Output:
<class ‘int’>
STILL GOT QUERIES?