{"response":"{\"What is the part of a list or sequence that follows the head?

The part of a list or sequence that follows the head is called the tail.

Imagine you're lining up for ice cream. The person at the front of the line, the first person, is like the head of the line. But everyone else behind them, waiting to get their treat, makes up the tail of the line.

So if we think of a list as an ice cream line:

  • The head is the first person.
  • The tail is everyone else in the line after that.

Just like you can take the first person out of the line (the head), you can also look at or work with the rest of the people, the tail. It's like saying, "Okay, now who’s next?" and then looking at all the other kids still waiting.

If we write this idea in a simple way:

  • A list is like an ice cream line.
  • The head is the first person.
  • The tail is everyone else after that, they’re still waiting for their turn.

Take the quiz →

Examples

  1. If the head of a line is the first person, the tail is everyone waiting behind them.
  2. In a list like [1, 2, 3], the head is 1 and the tail is [2, 3].
  3. The tail of your favorite song playlist is what plays after the first track.

Ask a question

See also

Discussion

Recent activity