adplus-dvertising
frame-decoration

Question

What is the output of the following code ?
class Count:
    def __init__(self, count = 0):
       self.__count = count
 
c1 = Count(2)
c2 = Count(2)
print(id(c1) == id(c2), end = " ")
 
s1 = "Good"
s2 = "Good"
print(id(s1) == id(s2))

a.

True False

b.

True True

c.

False True

d.

False False

Posted under Strings in Python Python

Answer: (c).False True

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 ?