Evaluate in Python: (2 + 3 2 + 4 // 2 5 % 3 - 1) 2

  1. 20
  2. 24
  3. 22
  4. 50
Answer

C) 22

Precedence: first (3^2 = 9), then //, , % left to right (4//2=2, 2 5=10, 10 % 3 = 1), then +/-: 2+9+1-1 = 11; 11 2 = 22. SLO CS-11-C-02 · Application

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