+ 1
What happens if i index with 0 as a step?
In list slicing, taking nums = [2, 4, 7, 8, 22, 54, 1, 0] as an example. when we try to print(nums[1:6:2]), the output is >>>[4, 8, 54] right.? now what if i try to print (nums[1:6:0] ), what happens and why, thanks!
2 Answers
+ 3
Why not run the code and get the answer to your question?
+ 2
Unfortunately it just throws an error as list slice 0 is not viable