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.
このコードがあります:
a = [1, 2, 3, 4, 5] a[2:4:-1] # returns [] a[4:2:-1] # returns [5, 4]
範囲が指定されているのに、ステートメントa[2:4:-1]が空のリストを返すのはなぜですか?
a[2:4:-1]
使用しようとすると、明らかに機能しないa[2:4:-1]リスト インデックス2から逆方向に移動しようとします。4
2
4