Artificial Intelligence

CBSE Class 9 Artificial Intelligence (402) Unit 5 – Introduction to Python Important Subjective Questions with Answers

Class 9 · Artificial Intelligence

CBSE Class 9 Artificial Intelligence (402)

Unit 5 – Introduction to Python

These important subjective questions are prepared according to the latest CBSE competency-based examination pattern and are completely based on the CBSE Class 9 Artificial Intelligence Facilitator Handbook. The questions include competency-based, case-study, application-based and Higher Order Thinking Skills (HOTS).

Instructions

  • Total Questions : 25
  • This section contains 10 Questions of 2 Marks each.
  • Read every question carefully.
  • Support your answers with suitable examples wherever possible.

Section A – 2 Mark Questions

Q1. Define Python. Mention any two reasons why Python is popular for Artificial Intelligence.

Answer:

Python is a high-level, easy-to-learn programming language widely used for Artificial Intelligence, Machine Learning and software development.

Reasons:

  • Simple and easy-to-read syntax.
  • Requires fewer lines of code.
  • Large collection of libraries for AI.
  • Supports code reusability.

Q2. Differentiate between Interactive Mode and Script Mode in Python.

Answer:

Interactive Mode Script Mode
Executes one statement at a time. Executes an entire program.
Result appears immediately. Program is saved for future use.
Useful for testing commands. Useful for developing complete applications.

Q3. What is a Variable? Explain with an example.

Answer:

A variable is a named memory location used to store data values.

Example:

age = 15
name = "Rahul"

Here, age and name are variables.


Q4. Name any four arithmetic operators used in Python.

Answer:

Operator Purpose
+ Addition
- Subtraction
* Multiplication
/ Division

Q5. Explain any two data types used in Python.

Answer:

  • Integer (int) – Stores whole numbers such as 25, 100 and 500.
  • String (str) – Stores text enclosed within quotation marks.

Example:

marks = 95
name = "Riya"

Q6. What is the purpose of the print() and input() functions?

Answer:

  • print() displays output on the screen.
  • input() accepts data from the user.

Example:

name = input("Enter your name:")
print(name)

Q7. What is Type Conversion? Why is it required?

Answer:

Type Conversion means converting one data type into another.

It is required because the input() function always accepts data as a string.

Example:

age = int(input("Enter age:"))

Q8. What is the purpose of an if statement? Give one example.

Answer:

The if statement is used to make decisions in a program.

Example:

age = 18

if age >= 18:
    print("Eligible to Vote")

Q9. Differentiate between for loop and while loop.

Answer:

For Loop While Loop
Repeats a fixed number of times. Repeats until a condition becomes false.
Used when number of iterations is known. Used when number of iterations is unknown.

Q10. What is a List in Python? Mention any two list functions.

Answer:

A List is an ordered collection used to store multiple values in a single variable.

Examples of List Functions:

  • append()
  • remove()
  • sort()
  • len()

Section B – 3 Mark Questions

Q11. (Competency Based)

A student wants to write a Python program that accepts the marks of five subjects and displays the average marks on the screen.

Answer the following:

  1. Which Python function will be used to accept the marks?
  2. Which function will display the average?
  3. Why is int() required while accepting the marks?

Answer:

(i) input() function.

(ii) print() function.

(iii)

The input() function accepts data as a string. The int() function converts it into an integer so mathematical calculations can be performed.


Q12. (Case Study Based)

A school wants to prepare a Python program that checks whether a student is eligible for the Science Club. Students scoring 80 marks or above are selected automatically.

Answer the following:

  1. Which control statement should be used?
  2. Write the condition required.
  3. Why are conditional statements useful?

Answer:

(i) if statement.

(ii)

if marks >= 80:

(iii)

Conditional statements allow the computer to make decisions based on different situations.


Q13. Explain the purpose of Variables, Data Types and Operators in Python with suitable examples.

Answer:

  • Variables store data values.
  • Data Types specify the type of data stored.
  • Operators perform mathematical calculations.

Example:

length = 20
breadth = 10
area = length * breadth
print(area)

Q14. (Application Based)

Explain the difference between Integer, Float and String data types using suitable Python examples.

Answer:

Data Type Description Example
Integer Whole numbers 25
Float Decimal numbers 85.75
String Text enclosed within quotes "Python"

Q15. (Competency Based)

A programmer wants to display the first ten even numbers using Python.

Answer the following:

  1. Which looping statement is most suitable?
  2. Why is this loop preferred?
  3. Name another loop available in Python.

Answer:

(i) for loop.

(ii)

The number of repetitions is already known, therefore the for loop is most suitable.

(iii) while loop.


Q16. (HOTS)

Python is considered one of the best programming languages for Artificial Intelligence.

Explain any three reasons supporting this statement.

Answer:

  • Easy to learn and understand.
  • Simple syntax reduces programming errors.
  • Provides a large collection of AI libraries.
  • Supports rapid application development.

Q17. (Case Study)

A teacher wants to store the names of all students participating in a quiz competition. New names should be added whenever additional students register.

Answer the following:

  1. Which Python data structure should be used?
  2. Which function will add new names?
  3. Which function will count the total number of students?

Answer:

(i) List.

(ii) append()

(iii) len()


Q18. (Competency Based)

A student prepares a Python program that accepts the length and breadth of a rectangle from the user and calculates its area.

Answer the following:

  1. Which arithmetic operator is used?
  2. Which function accepts the input values?
  3. Why is type conversion necessary?

Answer:

(i) Multiplication operator (*).

(ii) input() function.

(iii)

Since input() returns string values, they must be converted into integers using int() before multiplication.


Section C – 4 Mark Questions

Q19. (Case Study Based)

A school wants to develop a Python program to calculate the average marks of students in five subjects and display whether the student has passed or failed. A student passes if the average marks are 40 or above.

Answer the following:

  1. Which Python function is used to accept marks from the user?
  2. Which arithmetic operator is used to calculate the average?
  3. Which conditional statement is suitable for checking the result?
  4. Why is int() required while accepting marks?

Answer:

(i) input() function.

(ii) Division operator (/).

(iii) if...else statement.

(iv)

The input() function stores values as strings. The int() function converts them into integers so arithmetic operations can be performed.


Q20. Explain the role of Variables, Operators, Data Types and Expressions in Python with suitable examples.

Answer:

Concept Description Example
Variable Stores data values. x = 10
Data Type Specifies the type of stored data. int, float, str
Operator Performs calculations. +, -, *, /
Expression Combination of variables and operators. area = length * breadth

Q21. (Competency Based)

A library maintains the names of books in a Python list. Every month, new books are added and damaged books are removed from the list.

Answer the following:

  1. Which Python data structure is suitable?
  2. Which function adds a new book?
  3. Which function removes a book?
  4. Which function counts the total number of books?

Answer:

(i) List.

(ii) append()

(iii) remove() (or del statement).

(iv) len()


Q22. (Application Based)

A student is writing a Python program to display the multiplication table of a number entered by the user.

Answer the following:

  1. Which looping statement is most suitable?
  2. Why is this loop preferred?
  3. Name another looping statement available in Python.
  4. State one practical application of loops.

Answer:

(i) for loop.

(ii)

The multiplication table requires a fixed number of repetitions (usually 10), therefore the for loop is the best choice.

(iii) while loop.

(iv)

Loops are used to perform repetitive tasks automatically, reducing coding effort.


Q23. (Case Study Based)

A shopkeeper wants a Python program that accepts the customer's purchase amount. If the purchase amount is ₹5000 or more, the customer receives a 10% discount; otherwise, no discount is given.

Answer the following:

  1. Which control statement should be used?
  2. Write the condition required.
  3. Why are conditional statements important in programming?
  4. Name one other situation where conditional statements are useful.

Answer:

(i) if...else statement.

(ii)

if amount >= 5000:

(iii)

Conditional statements enable the computer to make decisions based on different conditions.

(iv)

Checking voting eligibility, examination results or age verification.


Q24. (HOTS)

Python has become one of the most widely used programming languages in Artificial Intelligence. Explain any four advantages of Python that make it suitable for AI development.

Answer:

  • Easy and readable syntax.
  • Large collection of AI and Machine Learning libraries.
  • Requires fewer lines of code, improving productivity.
  • Supports modular programming and code reuse.
  • Large developer community and excellent documentation.

Q25. (Integrated Competency Question)

A school plans to develop a Python application that stores student names, calculates average marks, displays examination results and prints a merit list automatically.

Answer the following:

  1. Name any four Python concepts required to develop this application.
  2. Explain the purpose of each concept.
  3. Which Python data structure will store multiple student names?
  4. Why is Python suitable for developing such educational applications?

Answer:

(i) Required Concepts

  • Variables
  • Data Types
  • Conditional Statements
  • Loops
  • Lists

(ii) Purpose

  • Variables store student information.
  • Data Types define the type of stored data.
  • Conditional statements determine pass or fail.
  • Loops process multiple student records automatically.

(iii) Python List.

(iv)

  • Easy to learn.
  • Simple syntax.
  • Fast application development.
  • Suitable for Artificial Intelligence and educational software.

Revision Tips

  • Revise the features and applications of Python.
  • Understand the difference between Interactive Mode and Script Mode.
  • Practice using print() and input() functions.
  • Revise Variables, Data Types, Operators and Expressions.
  • Practice Type Conversion using int(), float() and str().
  • Understand decision-making using if, elif and else.
  • Practice for and while loops.
  • Revise List operations such as append(), remove(), sort() and len().
  • Practice writing simple Python programs based on real-life situations.
  • Focus on competency-based and case-study questions following the latest CBSE examination pattern.

★★★★★ End of Class 9 AI Unit 5 Subjective Question Bank with Answers ★★★★★