MathTop

repeat_list 函数

按指定次数重复一个元素,生成列表。

语法

  • repeat(item, count)
  • repeat_list(item, count)

参数与选项

item要重复的元素。
count生成的副本数量。

示例

  1. 重复元素repeat(x, 4)返回 [x, x, x, x]。