# complement 関数

ほかのどのリストにも含まれない、リストの要素。

## 書き方

### complement(all, others, ...)

**all**

要素を取り出すリスト。リストを受け取ります。

**others**

除外する要素のリスト。リストを受け取ります。

## 例題

- $\displaystyle \operatorname{complement}(\left[ 1, 2, 3 \right], \left[ 2 \right]) = \left[ 1, 3 \right]$

  `complement([1, 2, 3], [2])`

  ソルバーでは、`complement([1, 2, 3], [2])` の答えは `[1, 3]` です。

  [ソルバーで開く](https://ja.hilberon.com/?q=complement%28%5B1%2C%202%2C%203%5D%2C%20%5B2%5D%29)

## 関連する関数

- [constant_array](https://ja.hilberon.com/library/constant_array)

  値のコピーのリスト。
- [apply](https://ja.hilberon.com/library/apply)

  式の先頭、またはリストの括弧を関数で置き換えます。
- [count](https://ja.hilberon.com/library/count)

  リスト中で値に等しい要素の個数。
- [append](https://ja.hilberon.com/library/append)

  末尾に要素を追加したリスト。
- [dimensions](https://ja.hilberon.com/library/dimensions)

  リストまたは行列の大きさを階層ごとに。
- [accumulate](https://ja.hilberon.com/library/accumulate)

  リストの累積和。

---
Source: https://ja.hilberon.com/library/complement
