Jun-21-2022, 10:09 PM
(This post was last modified: Jun-21-2022, 10:09 PM by deanhystad.)
The function doesn't require any prior knowledge of the len of a or any of the row (lists) in a. It uses len() to get that information.
From the output it looks like out of range indices should "wrap-around". From your example a[-1] changes to a[2] and a[3] changes to a[0]. You should read up about lists and how it handles different index values. You'll need something that checks the range of the index values and does the wrap-around when needed.
From the output it looks like out of range indices should "wrap-around". From your example a[-1] changes to a[2] and a[3] changes to a[0]. You should read up about lists and how it handles different index values. You'll need something that checks the range of the index values and does the wrap-around when needed.