✦ New Age Learning
Home › Learn › Class 8 › Computer & AI › Python: Lists, Functions and Strings

Class 8 Computer & AI Chapter 1: Python: Lists, Functions and Strings — practice questions with answers

Free practice for Class 8 Computer & AI, Chapter 1: Python: Lists, Functions and Strings. Try the solved questions below, then take a free test with instant marking and explanations.

47 questions17 easy, 20 medium, 10 hardNCERT · CBSE · State boards

Sample questions with solutions

Q1. What does this Python code print? marks = [72, 85, 90, 64] print(marks[1])
Show answer
Answer: 85 (± 0)
Why: List positions (indexes) start at 0, so marks[1] is the second item, 85. [NAL syllabus, Class 8 Unit 1]
Q2. What does this code print? fruits = ['mango', 'banana', 'guava'] print(len(fruits))
Show answer
Answer: 3 (± 0)
Why: len() counts the items in a list: 3. [NAL syllabus, Class 8 Unit 1]
Q3. What does this code print? def square(n): return n * n print(square(7))
Show answer
Answer: 49 (± 0)
Why: The function returns 7 × 7 = 49. [NAL syllabus, Class 8 Unit 1]
Q4. What does this code print? word = 'PYTHON' print(word[0])
  1. P
  2. Y
  3. N
  4. PYTHON
Show answer
Answer: A. P
Why: A string is indexed like a list; index 0 is the first letter. [NAL syllabus, Class 8 Unit 1]
Q5. What does this code print? city = 'Bengaluru' print(city.upper())
  1. BENGALURU
  2. bengaluru
  3. Bengaluru
  4. B
Show answer
Answer: A. BENGALURU
Why: .upper() changes every letter to capitals. [NAL syllabus, Class 8 Unit 1]
Q6. What does this code print? name = 'Asha' print('Hello, ' + name + '!')
  1. Hello, Asha!
  2. Hello, name!
  3. Hello,Asha
  4. 'Hello, ' + Asha
Show answer
Answer: A. Hello, Asha!
Why: The + sign joins (concatenates) strings. [NAL syllabus, Class 8 Unit 1]

Practise all 47 questions free

Timed test, marked instantly, with the correct answer and explanation for every question and a chapter-wise report.

Start the free test

Frequently asked questions

How many practice questions are there for Class 8 Computer & AI Chapter 1: Python: Lists, Functions and Strings?

47 questions (17 easy, 20 medium, 10 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 8 Computer & AI syllabus, used by CBSE and many state boards.

← All chaptersDatabases and Organising Data →