Python · 类

反转

Return a reverse iterator over the values of the given sequence.

调用签名(sequence, /)
ZHONGWEN
PYTHON
Chinese example

中文代码示例

# 案例:反转
打印(列表(反转([1, 2, 3])))
可直接放进 .cs / .中py 文件运行。转换器会把中文代码交给真实 Python 解释器。
Parameters

参数说明

1 个参数
参数类型 / 传入方式说明
sequence可选 · 默认 无
未声明位置参数,按顺序直接传值

按函数业务含义传入 sequence;首次使用建议先 打印(结果) 确认其作用。

常见错误:漏传会报 TypeError: missing required argument: 'sequence';检查调用是否漏了这行
Playbook

基础用法 · 进阶组合 · 错误排查

# 案例:反转
打印(列表(反转([1, 2, 3])))