Python MCQ Quiz Hub

MCQ Introduction to Python Section 3

Choose a topic to test your knowledge and improve your Python skills

>>> bool(0) evaluates to __





✅ Correct Answer: 4

____ operators are used to check if a value is a member of the given sequence or not.





✅ Correct Answer: 3

Write the output of following code: >>> n1 = 5 >>> n2 = n1 >>> n2 is n1





✅ Correct Answer: 1

Which operators can be used to determine whether two variables are referring to the same object or not.





✅ Correct Answer: 3

Which of the following is valid membership operator?





✅ Correct Answer: 3

_________ is defined as a combination of constants, variables, and operators.





✅ Correct Answer: 2

Which of the following is invalid expression?





✅ Correct Answer: 4

Binary operators are operators with ________ operands





✅ Correct Answer: 2

>>> 14 + 2 ** 2 evaluates to





✅ Correct Answer: 2

>>> 15.0 / 4 + (8 + 3.0) evaluates to ________________





✅ Correct Answer: 1

>>> 15.0 / 4 + (8 + 3.0) evaluates to ________________





✅ Correct Answer: 1

>>> 15.0 / 4 + (8 + 3.0) evaluates to ________________





✅ Correct Answer: 1

In Python, we have ____________________ function for taking input from the user.





✅ Correct Answer: 1

The user may enter a number or a string but the input() function treats them as _





✅ Correct Answer: 3

Write the output of the following : >>> age = input("Enter your age: ") >>> type(age)





✅ Correct Answer: 2

Write the output of the following : >>> age = input("Enter your age: ") Enter your age: 3 >>> age * 3





✅ Correct Answer: 2

What type of error is returned by following statement? >>> age = input("Enter your age: ") Enter your age: 3 >>> age + 3





✅ Correct Answer: 4

Python uses _________________ function to output data to standard output device.





✅ Correct Answer: 1

print(“I” + “am” + “in” + “school”) display ___





✅ Correct Answer: 3

print(“I” , “am” , “in” , “school”) display __





✅ Correct Answer: 1

Which of the following is parameter of print( ) function?





✅ Correct Answer: 3

int(123.45) is an example of _





✅ Correct Answer: 1

________ happens when data type conversion is done automatically by Python.





✅ Correct Answer: 1

Write the output of the following : num1 = 100 num2 = 2.0 sum1 = num1 + num2 print(sum1)





✅ Correct Answer: 2

In given code _____________ conversion takes place. num1 = 100 num2 = 2.0 sum1 = num1 + num2 print(sum1)





✅ Correct Answer: 1

Which of the following function convert the data type of variable ‘x’ from float to integer?





✅ Correct Answer: 2

Which of the following is explicit type conversion function in Python?





✅ Correct Answer: 4

Fill in the blank in given code : print("The total in Rs." + __________(70))





✅ Correct Answer: 3

In the given code, an integer value stored in variable num1 is added to a float value stored in variable num2, and the result is stored in variable sum1. This is an example of _____ sum1 = num1 + num2





✅ Correct Answer: 1

The process of removing errors from programs is called _________





✅ Correct Answer: 3

Which of the following error may encounter in program of python?





✅ Correct Answer: 4

Ravi is writing a program of printing “Hello World” but he forgot to close the bracket of print( ) function (as shown below). What type of error is this? print("Hello World"





✅ Correct Answer: 1

___ produces an undesired output but without termination of the program. a. Syntax error b. Logical error c.





✅ Correct Answer: 2

Aman wants to find the average of two numbers 10 and 12 and he write the code as 10 + 12/2, it would run successfully but the output is not correct. What type of error is done by Aman?





✅ Correct Answer: 2

___ error causes abnormal termination of program while it is executing.





✅ Correct Answer: 3

Which of the following statement return run time error ?





✅ Correct Answer: 1

Errors in program is also called ____





✅ Correct Answer: 2

IDLE stands for __________





✅ Correct Answer: 2

IDLE stands for __________





✅ Correct Answer: 2

Which of the following statement is correct to initialize multiple variables?





✅ Correct Answer: 1

Which of the following statement is correct syntactically ?





✅ Correct Answer: 2

Write the output of the following : print(true and False)





✅ Correct Answer: 3

Write the output of the following : print(3 and (5 or 0))





✅ Correct Answer: 2

Write the output of the following : print(True and (False or True))





✅ Correct Answer: 1

Write the output of the following code : print((15 // 2 ** 2) * 'A')





✅ Correct Answer: 3

Write the output of the following : 22 + (7 -2 // 9 ** 2) a. 22 b. 7 c. 29 d. 0





✅ Correct Answer: 3

Which of the following is mutable data type?





✅ Correct Answer: 3