I am a beginner to programming and was trying how to learn to flip every alternate row in my 2-D array(python)
For Example:
`Input
a=[[1,2,3,4,5],
[10,9,8,7,6],
[11,12,13,14,15],
[20,19,18,17,16],
[21,22,23,24,25],
[30,29,28,27,26]]'
Output
a_f=[[1,2,3,4,5],
[6,7,8,9,10],
[11,12,13,14,15],
[16,17,18,19,20],
[21,22,23,24,25],
[26,27,28,29,30]] `
I tried using flip function from python doc strings but it reversed the whole array. Also is it possible that a code can flip every alternate row without me needing to specify how many rows are there every time.