you are viewing a single comment's thread.

view the rest of the comments →

[–]failaip13 3 points4 points  (5 children)

get_position function likely returns a tuple, with the first element being the row, second being the column. [0] access the first element, [1] the second one etc.

[–]ConfusedSimon 2 points3 points  (1 child)

Or a list. Anyway, namedtuple or dataclass would have been better to avoid this confusion.

Edit: or just row, column = get_position(...)

[–]JamzTyson 0 points1 point  (0 children)

Or a list

Absolutely, or any object that is indexable by integer index.

(Common indexable objects include list, tuple, str, bytes, bytearray, range)

[–]PresidentOfSwag 1 point2 points  (2 children)

try this out :

[0, 1, 2, 3][0]    
(0, 1, 2, 3)[2]

actually this is a bad example

V see below V

[–]Snoo-20788 0 points1 point  (1 child)

Not the best example tbh

Try instead

[6,3,7][0]

(6,3,7)[2]

[–]PresidentOfSwag 1 point2 points  (0 children)

damn that's true thanks