Explore Courses Blog Tutorials Interview Questions
+3 votes
in Python by (3.4k points)
edited by

In Python how can I convert an integer to a string? I am trying this:

r = 16

I am trying to convert it to a string but it's showing an error like int , I was hoping a str  attribute but there's nothing like that.

2 Answers

0 votes
by (2k points)
edited by

The error you are facing is because of d.str() , try this:

>>> str(20)
>>> int('20')

Doubts in comments, cheers......!! 

0 votes
by (106k points)

Try this:


You can use the following video tutorials to clear all your doubts:-

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
+1 vote
2 answers

Browse Categories