Space Python Loading Python…

List Methods - append, insert, pop

 
0:00 / 0:00

Challenge

Practise what this example shows with these challenges.

Roster changes

Write the codeEasy 2 stages

Apply a day's crew changes to a list: append() a new member, insert() a backup at position 1, remove() someone who left, then pop() the newest member and print who was reassigned.

Start the challenge

Undo and history

Write the codeHard 2 stages

Extend the working cargo console: record every change to the hold in a history list and show it with a history command, then add undo, which takes the last change off the history and reverses it.

Start the challenge

Discussion

Stuck on this example or want to go further? Ask here, or see what others asked.

Log in to ask and reply.

script.py
PythonLn 1, Col 1Spaces: 4
Loading the Python environment…

Separate arguments with commas. They're passed on every Run as sys.argv[1:].