+ 9

How can i convert a number into a string?

2nd Feb 2020, 4:04 AM
SHADOW 🌀
SHADOW 🌀 - avatar
9 Respostas
+ 10
So can I use the inbuilt function str()
2nd Feb 2020, 4:24 AM
SHADOW 🌀
SHADOW 🌀 - avatar
+ 7
And remember everything generated by input() already IS a string, so you NEVER need str(input()).
2nd Feb 2020, 5:53 AM
David Ashton
David Ashton - avatar
+ 5
Thank you so much
2nd Feb 2020, 4:25 AM
SHADOW 🌀
SHADOW 🌀 - avatar
+ 2
This is how you do it- num = int(input()) val = str(num) You can check the type like this- print(type(val))
2nd Feb 2020, 4:22 AM
Avinesh
Avinesh - avatar
+ 1
//Bunch of related Codes on codes section, you can see for reference . https://code.sololearn.com/cL5FgXTnx0R9/?ref=app
2nd Feb 2020, 4:20 AM
Sudarshan Rai
Sudarshan Rai - avatar
0
Yes
2nd Feb 2020, 4:24 AM
Avinesh
Avinesh - avatar
0
use str() function to convert given input to string
2nd Feb 2020, 3:19 PM
sree harsha
sree harsha - avatar
0
Use str() function
3rd Feb 2020, 6:01 AM
Akash Singh
0
add str
6th Feb 2020, 2:48 PM
Parneet Sekhon