What is the output? python total = 0 for i in range(1, 5): total += i print(total)
- 10
- 15
- 9
- 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
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