-2

I want to add the quotes to the object.

For example,

[As-is]

a = 100

[To-be]

a = '100'

Please somebody help me.

SJJ
  • 25
  • 3
  • 2
    Your question is confusing. You can use `str` to convert an integer to a string. However, `print(100)` and `print('100')` produce exactly the same output. What is the larger problem you are trying to solve? – Tim Roberts Aug 28 '22 at 03:31
  • 1
    The object doesn't have any quotes. This is *crucial* to understand. – juanpa.arrivillaga Aug 28 '22 at 03:56

2 Answers2

1

The quotes around a value simply indicate that it is a string. If you want to convert an object to a string you can simply use the str() function like so

a = 100
b = str(a)
print(b)
BTables
  • 4,413
  • 2
  • 11
  • 30
1
a = 100
a = str(a)
a # outputs '100'
Nickofthyme
  • 3,032
  • 23
  • 40
ONMNZ
  • 322
  • 3
  • 8