adplus-dvertising
frame-decoration

Question

What is the output of the following code ?
class tester:
    def __init__(self, id):
        self.id = str(id)
        id="224"
 
>>>temp = tester(12)
>>>print(temp.id)

a.

224

b.

Error

c.

12

d.

None

Posted under Strings in Python Python

Answer: (c).12

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the following code ?