MathTop

rotate_right 函数

把列表元素向右旋转指定位置,末尾元素回绕到开头。

语法

  • rotate_right(list, count)
  • RotateRight(list, count)

参数与选项

list形如 [1, 2, 3] 的列表字面量。
count旋转的位置数;省略时默认为 1。

示例

  1. 向右旋转RotateRight([x, y, z, w], 2)返回 [z, w, x, y]。