What does this program print? python squares = [] for i in range(1, 5): squares.append(i i) print(squares)

  1. [1, 4, 9, 16]
  2. [0, 1, 4, 9]
  3. [1, 4, 9, 16, 25]
  4. [2, 4, 6, 8]
Answer

A) [1, 4, 9, 16]

range(1, 5) gives 1–4; each square is appended. SLO CS-11-C-05 · Application

Computer Science MCQ · More Unit 3: Programming Fundamentals MCQs · Practise