Python MCQ Quiz Hub

MCQ Introduction to Python Section 2

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

Output of print(2 * 3 ** 2) is





✅ Correct Answer: 3

Write the output of the following: x = int(7) + int (‘9’) print(x)





✅ Correct Answer: 2

Out of addition(+) and Subtraction (-) operator, which has more precedence?





✅ Correct Answer: 3

Which of the following statement will return error when x = 7 ?





✅ Correct Answer: 3

Which of the following store data in pair?





✅ Correct Answer: 4

What is the return type of function id( )?





✅ Correct Answer: 3

An ordered set of instructions to be executed by a computer to carry out a specific task is called ___





✅ Correct Answer: 3

Computers understand the language of 0s and 1s which is called _______





✅ Correct Answer: 4

A program written in a high-level language is called _________ code





✅ Correct Answer: 2

Python uses ____ to convert its instructions into machine language.





✅ Correct Answer: 1

Language translator convert ______________ code to _______________ code.





✅ Correct Answer: 1

Which of the following is not the feature of python language?





✅ Correct Answer: 4

In which of the following mode, the interpreter executes the statement and displays the result as soon as we press ‘Enter’ key?





✅ Correct Answer: 1

By default, the Python scripts are saved with ____________ extension.





✅ Correct Answer: 3

By default, the Python scripts are saved in ____





✅ Correct Answer: 3

________ are reserved words.





✅ Correct Answer: 1

Which of the following is not correct for naming an identifier in Python?





✅ Correct Answer: 4

Comments in python program are ________________ by interpreter





✅ Correct Answer: 2

In Python single line comment starts with __





✅ Correct Answer: 4

In Python multi line comment starts with _________





✅ Correct Answer: 2

Which of the following is a sequence data type?





✅ Correct Answer: 1

_________ is a set of valid characters that a language can recognize.





✅ Correct Answer: 3

The smallest individual unit in a program is known as _





✅ Correct Answer: 1

Which of the following is token in Python?





✅ Correct Answer: 4

Which of the following is String literal?





✅ Correct Answer: 3

Variables of data types like integers, float etc., hold __





✅ Correct Answer: 1

Which of the following is invalid data type in python?





✅ Correct Answer: 4

Multiline string in python can be created by enclosing text in ____





✅ Correct Answer: 3

Which of the following is mapping data type in Python?





✅ Correct Answer: 3

Variables whose values can be changed after they are created and assigned are called __





✅ Correct Answer: 1

An _______________ is a symbol which is used to perform specific mathematical or logical operation on values.





✅ Correct Answer: 2

Operators work on values called ___





✅ Correct Answer: 2

Which operator returns remainder?





✅ Correct Answer: 3

86. Which of the following is an exponent operator?





✅ Correct Answer: 3

Which of the following statement display “RAM” two times?





✅ Correct Answer: 2

Write the output of the following: >>> 7 % 3 ** 3





✅ Correct Answer: 2

Which of the following is not an integer literal?





✅ Correct Answer: 4

Which escape sequence represent newline character?





✅ Correct Answer: 1

Which of the following is number data type in python?





✅ Correct Answer: 4

Which of the following is an invalid relational operator in Python?





✅ Correct Answer: 4

print(3 != 4) will evaluates __





✅ Correct Answer: 1

Which of the following is an assignment operator?





✅ Correct Answer: 4

Statement x += y is equivalent to ______





✅ Correct Answer: 1

Write the output of the following : >>> num1 = 7 >>> num2 = 3 >>> num1 //= num2 >>> num1





✅ Correct Answer: 3

Write the output of the following : >>> a = 'India' >>> a *= 3 >>> a





✅ Correct Answer: 3

Which of the following is invalid logical operator?





✅ Correct Answer: 4

print(bool(3 and 6)) evaluates to __





✅ Correct Answer: 2

print(bool(True and True or False)) evaluates to ___





✅ Correct Answer: 2

101. >>> bool(0) evaluates to _





✅ Correct Answer: 1

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





✅ Correct Answer: 3