May 2026 Primers
Accenture Mock 2026mediumMay 2026 PrimersFile Handling

What will be the content of file shop.txt after executing the shown Python code that writes Apple, Orange, Banana and then swaps the first and third lines?

Answer options

A
Banana Orange Apple
B
Apple Banana Orange
C
Orange Banana Apple
D
Banana Apple Orange

Correct answer: Banana Orange Apple

Explanation

The code swaps content[0] and content[2], so Apple and Banana exchange positions while Orange remains in the middle.

Related Accenture May 2026 Primers questions

Practice more Accenture May 2026 Primers questions

PrimerDumps has 1400+ primer questions, 2026 mocks and coding hands-on — all free.