Home » Programming Language (coding) » Python MCQs » Study the following program: class Std_Name: def __init__(self, Std_firstName, Std_Phn, Std_lastName): self.Std_firstName = Std_firstName self. Std_PhnStd_Phn = Std_Phn self. Std_lastNameStd_lastName = Std_lastName Std_firstName = “Wick” name = Std_Name(Std_firstName, ‘F’, “Bob”) Std_firstName = “Ann” name.lastName = “Nick” print(name.Std_firstName, name.Std_lastName) What will be the output of this statement?

Study the following program: class Std_Name: def __init__(self, Std_firstName, Std_Phn, Std_lastName): self.Std_firstName = Std_firstName self. Std_PhnStd_Phn = Std_Phn self. Std_lastNameStd_lastName = Std_lastName Std_firstName = “Wick” name = Std_Name(Std_firstName, ‘F’, “Bob”) Std_firstName = “Ann” name.lastName = “Nick” print(name.Std_firstName, name.Std_lastName) What will be the output of this statement?

Study the following program:

class Std_Name:   
    def __init__(self, Std_firstName, Std_Phn, Std_lastName):  
        self.Std_firstName = Std_firstName  
        self. Std_PhnStd_Phn = Std_Phn  
        self. Std_lastNameStd_lastName = Std_lastName  
   
Std_firstName = "Wick"  
name = Std_Name(Std_firstName, 'F', "Bob")  
Std_firstName = "Ann"  
name.lastName = "Nick"  
print(name.Std_firstName, name.Std_lastName)  

What will be the output of this statement?

A. Ann Bob
B. Ann Nick
C. Wick Bob
D. Wick Nick

Correct Answer: Option D. Wick Nick 

Take Part in Discussion:

Your email address will not be published.

Solve : *
34 ⁄ 17 =