CBSE Class 9 Introduction to Python Important Subjective Questions & Answers (2026–27) | Unit 5 Artificial Intelligence
Class 9 · Artificial Intelligence
Prepare for your CBSE Class 9 Artificial Intelligence examination with these 25 important subjective questions and answers from Unit 5: Introduction to Python. These questions are based on the latest CBSE syllabus (2026–27) and are perfect for Unit Tests, Half-Yearly, Annual Examinations, competency-based assessments, and practical viva preparation.
Topics Covered
- Introduction to Python
- Features of Python
- Variables and Data Types
- Input and Output Functions
- Operators in Python
- Conditional Statements
- Loops
- Python Lists
- List Methods
- Competency-Based & HOTS Questions
CBSE Exam Tip: Practice writing Python programs, understand variables, operators, conditional statements, loops, and list operations. Remember important syntax, indentation rules, and frequently used functions such as print(), input(), and len().
Subjective Questions with Answers
Q1. Why is Python one of the most popular programming languages for Artificial Intelligence?
Show Answer
Answer:
Python is one of the most popular programming languages for Artificial Intelligence because it is simple, easy to learn, and easy to read.
It has a large collection of libraries, requires fewer lines of code, supports rapid development, and helps developers focus on solving AI problems instead of writing complex programs.
Q2. Explain the concept of Modularity. How does Python support modular programming?
Show Answer
Answer:
Modularity means dividing a large problem into smaller and manageable parts.
Python supports modular programming by allowing programmers to organize code into functions, modules, and libraries. This makes programs easier to understand, maintain, test, and reuse.
Q3. Name any three real-life applications of Python.
Show Answer
Answer:
Python is widely used in many fields, including:
- Artificial Intelligence and Machine Learning
- Software and Web Application Development
- Game Development and Online Learning Platforms
Q4. Differentiate between the print() function and the input() function.
Show Answer
print() |
input() |
|---|---|
| Displays output on the screen. | Accepts input from the user. |
| Used to show messages or results. | Used to collect information during program execution. |
Example: print("Hello") |
Example: name = input("Enter Name: ") |
Q5. What is a Variable? Give an example.
Show Answer
Answer:
A variable is a named memory location used to store data in a program.
Example:
age = 15
name = "Rohan"
Here, age and name are variables that store different types of values.
Q6. Define the following data types in Python: Integer, Float, and String.
Show Answer
Answer:
- Integer (int): Stores whole numbers without decimal points.
Example:25 - Float: Stores decimal numbers.
Example:98.5 - String (str): Stores text enclosed within single or double quotation marks.
Example:"Artificial Intelligence"
Q7. Explain Type Conversion with an example. Why is it required after using the input() function?
Show Answer
Answer:
Type Conversion is the process of converting one data type into another.
The input() function always returns data as a string. Therefore, numerical calculations require conversion to int or float.
Example:
age = int(input("Enter your age: "))
This converts the user's input into an integer before performing calculations.
Q8. Differentiate between the = operator and the == operator.
Show Answer
= |
== |
|---|---|
| Assignment Operator | Comparison Operator |
| Assigns a value to a variable. | Checks whether two values are equal. |
Example: x = 10 |
Example: x == 10 |
Q9. What are Logical Operators? Name the three logical operators used in Python.
Show Answer
Answer:
Logical operators combine multiple conditions and return either True or False.
The three logical operators are:
- and
- or
- not
Q10. Write a Python expression to calculate the average marks of three subjects (s1, s2, and s3).
Show Answer
Answer:
average = (s1 + s2 + s3) / 3
This expression adds the marks of the three subjects and divides the total by 3 to calculate the average.
Q11. Explain the purpose of the if...elif...else statement in Python.
Show Answer
Answer:
The if...elif...else statement is used for decision-making in Python.
- if checks the first condition.
- elif checks one or more additional conditions if the previous condition is false.
- else executes when none of the conditions are true.
This allows a program to perform different actions based on different situations.
Q12. Differentiate between a for loop and a while loop.
Show Answer
for Loop |
while Loop |
|---|---|
| Used when the number of iterations is known. | Used when the number of iterations is unknown. |
| Iterates over a sequence or range. | Runs until a specified condition becomes false. |
| Example: Printing numbers from 1 to 10. | Example: Asking for a password until it is correct. |
Q13. Write the Python logic to check whether a person is eligible to vote.
Show Answer
Answer:
age = int(input("Enter your age: "))
if age >= 18:
print("Eligible to Vote")
else:
print("Not Eligible to Vote")
The program checks whether the entered age is 18 or above. If true, the person is eligible to vote; otherwise, they are not eligible.
Q14. How can a for loop be used to find the sum of the first 10 natural numbers?
Show Answer
Answer:
sum = 0
for i in range(1, 11):
sum = sum + i
print(sum)
The loop adds each number from 1 to 10 and stores the result in the variable sum. The final output is 55.
Q15. Why is indentation important in Python?
Show Answer
Answer:
Python uses indentation (spaces at the beginning of a line) to define blocks of code.
It indicates which statements belong to an if statement, loop, or function. Incorrect indentation results in an IndentationError, causing the program to fail.
Q16. What is a Python List? How do you create one?
Show Answer
Answer:
A Python List is an ordered collection of multiple items stored in a single variable.
Lists are created using square brackets [].
Example:
students = ["Arjun", "Sonal", "Isha"]
Q17. Explain Indexing in Python Lists. Differentiate between Positive and Negative Indexing.
Show Answer
| Positive Indexing | Negative Indexing |
|---|---|
Starts from 0. |
Starts from -1. |
| Accesses elements from the beginning. | Accesses elements from the end. |
Example: list[0] |
Example: list[-1] |
Q18. Name and explain any three commonly used Python List methods.
Show Answer
Answer:
- append() – Adds a new element to the end of the list.
- remove() – Removes a specified element from the list.
- sort() – Arranges the list elements in ascending order.
Q19. What is the purpose of the len() function in Python?
Show Answer
Answer:
The len() function returns the total number of elements present in a list, string, or other collection.
Example:
names = ["Aman", "Riya", "Neha"]
print(len(names))
Output:
3
Q20. Differentiate between append() and extend() methods.
Show Answer
append() |
extend() |
|---|---|
| Adds one element at the end of the list. | Adds multiple elements from another list. |
| Takes a single item as an argument. | Takes an iterable such as another list. |
Example: list.append(10) |
Example: list.extend([10,20,30]) |
Q21. [Competency] A student wants to convert a distance of 5 kilometres into metres. Which arithmetic operator should be used? Write the Python statement.
Show Answer
Answer:
Since 1 kilometre = 1000 metres, we use the multiplication operator (*).
Python Statement:
meters = 5 * 1000
print(meters)
Output:
5000
Q22. [HOTS] Predict the output of the following Python code and justify your answer.
x = 10
y = "20"
print(x + int(y))
Show Answer
Answer:
Output:
30
Explanation:
The variable x is an integer, while y is a string.
The function int(y) converts the string "20" into the integer 20. Therefore, Python performs numerical addition:
10 + 20 = 30
Q23. [Competency] You have created the following participant list:
participants = ["Arjun", "Sonakshi", "Vikram"]
Write Python commands to:
- Add "Jay" at the end of the list.
- Remove "Vikram" from the list.
Show Answer
Answer:
participants.append("Jay")
participants.remove("Vikram")
After executing these statements, the list becomes:
["Arjun", "Sonakshi", "Jay"]
Q24. [HOTS] Why is a while loop more suitable than a for loop for checking a user's password?
Show Answer
Answer:
A while loop is more suitable because the number of attempts is unknown.
The loop continues until the user enters the correct password, whereas a for loop is generally used when the number of iterations is already known.
Therefore, a while loop provides greater flexibility for situations where the stopping condition depends on user input.
Q25. [Competency] A retail store offers a 10% discount if the bill amount is greater than ₹2000. Write a Python program to calculate the final bill.
Show Answer
Answer:
bill_amount = float(input("Enter Bill Amount: "))
if bill_amount > 2000:
discount = bill_amount * 0.10
final_bill = bill_amount - discount
else:
final_bill = bill_amount
print("Final Bill =", final_bill)
The program calculates a 10% discount only when the bill amount exceeds ₹2000; otherwise, the original bill amount is displayed.
❓ Quick Revision
- Python is easy to learn, readable, and widely used in Artificial Intelligence.
- Variables are used to store data values in memory.
- The commonly used data types are Integer, Float, String, Boolean, and List.
print()displays output, whileinput()accepts input from the user.- The
input()function returns data as a string, so type conversion is often required. - Assignment Operator (=) stores values, whereas Comparison Operator (==) compares values.
if...elif...elsestatements are used for decision-making, whileforandwhileloops are used for repetition.- Indentation is compulsory in Python because it defines code blocks.
- Lists are ordered collections created using square brackets
[]. - Important list methods include
append(),remove(),extend(),sort(), andlen().
? Exam Tip
For the CBSE Class 9 Artificial Intelligence examination, practice writing Python programs without syntax errors. Remember the difference between print() and input(), assignment (=) and comparison (==) operators, conditional statements, loops, and list methods. Always maintain proper indentation, trace programs carefully, and practice competency-based coding questions to score full marks.