Class 9 Computer & AI Chapter 1: Hello Python, Hello AI — practice questions with answers
Free practice for Class 9 Computer & AI, Chapter 1: Hello Python, Hello AI. Try the solved questions below, then take a free test with instant marking and explanations.
42 questions20 easy, 16 medium, 6 hardNCERT · CBSE · State boards
Sample questions with solutions
Q1. Why is Python the most popular language for AI teams in India and worldwide?
- Its syntax reads almost like English, it has huge free libraries (numpy, pandas, scikit-learn) and a massive community
- It is the only programming language
- It runs only on supercomputers
- It needs no computer at all
Show answer
Answer: A. Its syntax reads almost like English, it has huge free libraries (numpy, pandas, scikit-learn) and a massive community
Why: Used by ISRO, Sarvam AI, Niramai. [AI for New Learner — Senior 1, Ch 1]
Why: Used by ISRO, Sarvam AI, Niramai. [AI for New Learner — Senior 1, Ch 1]
Q2. In the statement age = 13, what is age?
- A variable — a name for a value
- A function
- A list
- A loop
Show answer
Answer: A. A variable — a name for a value
Why: Variables store values for later use. [AI for New Learner — Senior 1, Ch 1]
Why: Variables store values for later use. [AI for New Learner — Senior 1, Ch 1]
Q3. Which line correctly starts a function definition in Python?
- def greet():
- function greet()
- greet = def()
- define greet:
Show answer
Answer: A. def greet():
Why: The keyword def defines a function. [AI for New Learner — Senior 1, Ch 1]
Why: The keyword def defines a function. [AI for New Learner — Senior 1, Ch 1]
Q4. What does this code print? nums = [10, 20, 30] print(sum(nums))
- 60
- 3
- 102030
- [10, 20, 30]
Show answer
Answer: A. 60
Why: sum() adds all items in the list. [AI for New Learner — Senior 1, Ch 1]
Why: sum() adds all items in the list. [AI for New Learner — Senior 1, Ch 1]
Q5. What does this code print? marks = [85, 90, 75, 60] print(len(marks))
Show answer
Answer: 4 (± 0)
Why: len() counts the items: 4. [AI for New Learner — Senior 1, Ch 1]
Why: len() counts the items: 4. [AI for New Learner — Senior 1, Ch 1]
Q6. What does this code print? def double(x): return x * 2 print(double(7))
Show answer
Answer: 14 (± 0)
Why: double(7) returns 7 × 2 = 14. [AI for New Learner — Senior 1, Ch 1]
Why: double(7) returns 7 × 2 = 14. [AI for New Learner — Senior 1, Ch 1]
Practise all 42 questions free
Timed test, marked instantly, with the correct answer and explanation for every question and a chapter-wise report.
Start the free testFrequently asked questions
How many practice questions are there for Class 9 Computer & AI Chapter 1: Hello Python, Hello AI?
42 questions (20 easy, 16 medium, 6 hard). A few are solved on this page; the free test shows the answer and explanation for every question after you submit.
Is this chapter from the NCERT book?
Yes — it follows the NCERT Class 9 Computer & AI syllabus, used by CBSE and many state boards.