I could not find something similar.
Given, e.g.
lst = Range[10]
(* {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} *)
the following gives the reverse of lst (I know about Reverse).
lst[[-1 ;; 1 ;; -1]]
(* {10, 9, 8, 7, 6, 5, 4, 3, 2, 1} *)
Why the following does not return the same output?
lst[[;; ;; -1]]
Thanks.
Span, right? Otherwise it starts by default from the beginning. Is there any similar concept to Mathematica with Python's slicing? (Thanks for the commenf by the way!) – Dimitris Apr 09 '17 at 22:01SpanandPartcompared to Python's slicing? So far you have only shown that Mathematica uses a slightly different syntax. – C. E. Apr 09 '17 at 22:32lst[::-1]gives thelstreversed without prividing any start/end value. – Dimitris Apr 09 '17 at 22:371and end position toAllit cannot use;; ;; -1to produce the list reversed. See;; ;; -1 // InputForm. – Edmund Apr 09 '17 at 23:38