Answer and explanation

Correct answer: C. `'ABABABC'`

  1. Step 1: In Python, multiplying a string by an integer replicates that string: `3 * 'AB'` produces `'ABABAB'`.
  2. Step 2: The addition operator concatenates `'C'` to the end, resulting in `'ABABABC'`.
Answer
`'ABABABC'`.
Why not the others: '`ABCABCABC`' replicates `'ABC'`; '`AB3C`' treats 3 as a literal character; '`6C`' attempts numerical multiplication of letters.

Practise more Python Programming, Data Structures, Algorithms, Networks and Cybersecurity.

Free questions with an explanation for every one, and full timed Saudi Secondary School Certificate mock tests.