Home » Programming Language (coding) » Python MCQs » Python MCQ Questions and Answers (Part – 3)

Python MCQ Questions and Answers (Part – 3)

(Q) 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

Answer: D. Wick Nick

C. invalid code

Discuss Answer

(Q) How we can convert the Numpy array to the list in python?

A. list(array)
B. list.array
C. array.list
D. None of the above

Answer:A. list(array)

(Q) Which of the following is incorrect?

A. x = 0b101
B. x = 0x4f5
C. x = 19023
D. x = 03964 

Answer: D. x = 03964

(Q) Which of the following declarations is incorrect?

A. _x = 2
B. __x = 3
C. __xyz__ = 5
D. None of these

Answer: D. None of these

(Q) What is the output of print 0.1 + 0.2 == 0.3?

A. True
B. False
C. Machine dependent 
D. Error

Answer : B. False

(Q) Study the following program:

i = 1:
while True:
    if i%3 == 0:

Which of the following is the correct output of this program?

A. 1 2 3
B. 3 2 1
C. 1 2
D. Invalid syntax

Answer: D. Invalid syntax

(Q) In which year was the Python language developed?

A. 1995
B. 1972
C. 1981
D. 1989

Answer: D. 1989

Parts of Python MCQ Questions & Answers:

Discussion Board:

Take Part in Discussion:

Your email address will not be published.

Solve : *
30 ⁄ 10 =