Question: class Test : def __init__ ( self ): self .t1= T1 self .t2= T2 #main program x=Test() When x=Test() executes nothing happens in the memory

  1. class Test:   def __init__(self): self.t1="T1"  self.t2="T2"  #main program x=Test() 

    When x=Test() executes nothing happens in the memory unless we type print(x.t1) and print(x.t2). Then the object for the class is instantiated and the output is T1, T2.

    When x=Test() executes nothing happens in the memory unless we type print(x.t1). Then the object is instantiated and the output is T1.

    When x=Test() executes the class Test is calls the class Test to execute

    When x=Test() executes the __init__() method is called and executes.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!