Practice Set 1
Accenture Success Primer ExammediumMay 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

Quick AnswerThe correct answer is Banana Orange Apple because it directly addresses the core logic of Practice Set 1.

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

Related Accenture Practice Set 1 questions

Practice more Accenture Practice Set 1 questions

PrimerPrep has 1400+ practice questions, 2026 simulations and coding hands-on — all free.

Watch Walkthroughs!