互联网技术 / 互联网资讯 · 2023年10月28日

Python3数组翻转指定数量元素的云计算开发实例

定义一个整型数组,并将指定个数的元素翻转到数组的尾部。

例如:(aR[], d, n) 将长度为 n 的 数组 aRR 的前面 d 个元素翻转到数组尾部。

以下演示了将数组的前面两个元素放到数组后面。

实例一

以上实例输出结果为:

实例二

以上实例输出结果为:

实例三

以上实例输出结果为:

OpenMagic API

Need more than content? Move into the product flow.

If you are here for model access, pricing, developer docs, or the future API console, the dedicated product path now lives on api.openmagic.ai.