What is the output? python total = 0 for i in range(1, 5): total += i print(total)

  1. 10
  2. 15
  3. 9
  4. 4
Answer

A) 10

range(1, 5) gives 1, 2, 3, 4 → 10. SLO CS-11-C-02

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