What is printed? (a function with a bug) python def average(a, b): return a + b / 2 print(average(4, 6))
- 5.0
- 7.0
- 3.0
- 10
Answer
B) 7.0
Division happens first: 4 + 3.0 = 7.0 – a logical error. SLO CS-11-C-07
Computer Science MCQ · More Unit 3: Programming Fundamentals MCQs · Practise