Mutable and Immutable Types

Talk it through with a coach who asks guiding questions and gives hints until you reach the answer. Pass to mark the challenge as completed.

The problem

  • easy

In Python, a function that appends to a list passed in changes the caller's list, but a function that adds one to a number doesn't change the caller's number. Explain mutability and how it explains the difference.

Talk this problem through with an AI coach

Sign in with Google to start a free voice session — no credit card needed.

Start free →