Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我只是想知道是否有任何其他编程语言支持负索引。
关于C,指针可以像数字一样计算。所以请除了它。
但是在 python 中, my_list[-1] 是列表的最后一个。
Python 是唯一支持这种负索引概念的语言吗?
您的回答将很有帮助,具有各种语言经验。:)
祝你今天过得愉快 :)
根据这篇文章,
Ch
LiveCode
Mathematica
Python
Ruby
S-Lang
Wolfram Language
可以使用负索引从最后一个访问数组元素。