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?
Python is a high-level language. It is very easy to understand.
Q2. Which function is used to display output in Python code?
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?
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?
'if' is not a data type. It is used to write conditional statements.
Q5. Identify the Comparison Operator from the given options?
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?
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?
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])
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 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)
In the given code, an arithmetic operator is used, so both numbers are added and the answer will be 15.