introduction to Python mcq o level

In O Level, the Introduction to Python exam is of moderate difficulty, but around 60% of students fail this exam. Students who are going to appear for the Introduction to Python exam will get great benefits from this Introduction to Python MCQ O Level test. It will help them pass the exam and score very well.

Q1. What type of language is Python?

High level
Low level
Machine language
Assembly language
✅ Correct Answer: High level

Python is a high-level language. It is very easy to understand.

Q2. Which function is used to display output in Python code?

output
input
print
print_f
✅ Correct Answer: print

If we want to print anything in Python, we use the print function, which is built-in in Python.

Q3. What is used to store data in Python?

Function
Variable
Operator
Loops
✅ Correct Answer: Variable

We use variables to store data in Python. We can store all types of data in it like int, float, string, etc.

Q4. Which of the following is not a data type?

Int
Float
String
if
✅ Correct Answer: if

'if' is not a data type. It is used to write conditional statements.

Q5. Identify the Comparison Operator from the given options?

!=
+
-
and
✅ Correct Answer: !=

From the given options, '!=' is a comparison operator. '+', '-' are arithmetic operators and 'and' is a logical operator.

Q6. Which of the following loop does not exist in Python?

while loop
do while loop
for loop
all of these
✅ Correct Answer: do while loop

Python does not have a do while loop, but it exists in other programming languages.

Q7. Which is the correct code to create a list in Python?

numbers = [1,2,3,4]
numbers = (1,2,3,4)
numbers = {1,2,3,4}
numbers = }1,2,3,4{
✅ Correct Answer: numbers = [1,2,3,4]

To create a list in Python, we use [] (square brackets), and we add items inside it.

Q8. What will be the output of the given code?
numbers = [11,25,37,47,55,69]
print(numbers[1])

25
11
37
47
✅ Correct Answer: 25

In the given list, the item at index 1 is printed. In Python, counting starts from 0, and at index 1 the value is 25, so the output will be 25.

Q9. Identify the immutable data type from the following?

String
List
Dictionary
Set
✅ Correct Answer: String

String is immutable. When we try to change a string, it does not change and gives an error, whereas mutable data types can be modified.

Q10. What will be the output of the given code?
print(10 + 5)

10
15
105
error
✅ Correct Answer: 15

In the given code, an arithmetic operator is used, so both numbers are added and the answer will be 15.