KS4 Puzzle 10 Python – import from text file

Code / algorithm aim

The program should declare a list of fruit then display everything in the list on the screen.

The program should then open a text file called fruits and print each line of the text file before adding each item to the end of the list.

The program should close the text file then display to the user the new list with the added items.

WAIT! You aren’t logged in.
By logging in you can earn CS points and keep track of what you have done. Do you want to:


Join Now

Instructions (click to view)

All the code that you need has been given below. Simply organise the code blocks into the correct order so that the code follows the algorithm aim above.

You can organise the blocks by clicking on the arrows on the right hand side to place them above or below the other blocks.