Introduction to Python Class 8 MCQs with Answers
Introduction to Python – MCQs with Answers & Explanations
Class: CBSE Class 8 |
Subject: Computer Science |
Section: Introduction to Programming (Python / Coding Concepts) |
Topic: Introduction to Python Class 8
Based on NCERT Syllabus | CBSE Board Examination Format
Based on NCERT Syllabus | CBSE Board Examination Format
1. Python is a:
Answer: b) High-level language
Explanation: Python is easy to read and write. It uses simple English-like words, making it a high-level programming language.
Explanation: Python is easy to read and write. It uses simple English-like words, making it a high-level programming language.
2. Python was developed by:
Answer: c) Guido van Rossum
Explanation: Python was created by Guido van Rossum in 1991.
Explanation: Python was created by Guido van Rossum in 1991.
3. Which symbol is used to display output in Python?
Answer: a) print()
Explanation: The print() function is used to display output on the screen.
Explanation: The print() function is used to display output on the screen.
4. Which function is used to take user input in Python?
Answer: c) input()
Explanation: input() allows the user to enter data during program execution.
Explanation: input() allows the user to enter data during program execution.
5. Python files are saved with extension:
Answer: b) .py
Explanation: All Python programs are saved using the .py extension.
Explanation: All Python programs are saved using the .py extension.
6. Which of the following is a valid variable name?
Answer: b) name_1
Explanation: Variable names cannot start with numbers or special symbols except underscore.
Explanation: Variable names cannot start with numbers or special symbols except underscore.
7. Python is an example of:
Answer: b) Interpreted language
Explanation: Python code is executed line by line using an interpreter.
Explanation: Python code is executed line by line using an interpreter.
8. Comments in Python start with:
Answer: b) #
Explanation: The # symbol is used to write comments in Python.
Explanation: The # symbol is used to write comments in Python.
9. Which data type is used to store whole numbers?
Answer: c) int
Explanation: int represents integer values without decimals.
Explanation: int represents integer values without decimals.
10. Which data type is used for text?
Answer: b) str
Explanation: str (string) stores characters and text values.
Explanation: str (string) stores characters and text values.
11. Indentation in Python is used to:
Answer: c) Define blocks of code
Explanation: Indentation tells Python which statements belong together in loops or conditions.
Explanation: Indentation tells Python which statements belong together in loops or conditions.
12. Which operator is used for addition?
Answer: a) +
Explanation: The + symbol is used to add numbers.
Explanation: The + symbol is used to add numbers.
13. Which keyword is used for decision making?
Answer: b) if
Explanation: The if statement is used to test conditions.
Explanation: The if statement is used to test conditions.
14. Which loop repeats a block of code?
Answer: b) for
Explanation: The for loop is used to repeat instructions multiple times.
Explanation: The for loop is used to repeat instructions multiple times.
15. True and False values belong to:
Answer: c) bool
Explanation: Boolean data type stores only True or False values.
Explanation: Boolean data type stores only True or False values.
16. Python programs can be written in:
Answer: d) All of these
Explanation: Python code can be written in any text editor or IDE.
Explanation: Python code can be written in any text editor or IDE.
17. Which symbol is used for multiplication?
Answer: b) *
Explanation: The * symbol multiplies two numbers.
Explanation: The * symbol multiplies two numbers.
18. Which function converts string to integer?
Answer: b) int()
Explanation: int() converts numeric string into integer value.
Explanation: int() converts numeric string into integer value.
19. Which of the following is a Python keyword?
Answer: a) while
Explanation: while is used to create a loop based on condition.
Explanation: while is used to create a loop based on condition.
20. Python is popular because it is:
Answer: c) Easy to learn
Explanation: Python has simple syntax, making it beginner-friendly.
Explanation: Python has simple syntax, making it beginner-friendly.
