0

I am new to python and am having trouble understanding negative steps. Say I have mytuple = ("a", "b", "c", "d"), and I have something that says print(mytuple[:1:-1]) and the output is ("d", "c"). I understand the -1 is a negative step meaning it starts from the end but do not understand why the start (blank) and end (1) produce the output stated.

Any help in understanding the notation with this example and/or others would be greatly appreciated. Thanks

LukeS
  • 1
  • 1

0 Answers0