Introduction
I've found a clever and fun thing to do after solving a n2 × n2 sudoku puzzle. I can take a grid as such as this one and hard-code its indices as constraints to output other 4 × 4 latin squares in poly-time
Now, I took each successive row and hardcoded as indices with successive print statements.
Indices constraints
0123
3210
1032
2301
Working Code
print('enter with [1,2,3...] brackets')
text = input()[1:-1].split(',')
print(text[0], text[1], text[2], text[3])
print(text[3], text[2], text[1], text[0])
print(text[1], text[0], text[3], text[2])
print(text[2], text[3], text[0], text[1])
Question
Being a novice at python I'm asking is there a better way of hardcoding the Sudoku's pattern with fewer lines of code?
Because it would be daunting to have to write larger constraints for larger latin squares.
I would appreciate it to keep it O(n) time because I have a desire to input integers besides just elements 1-4. But, 100-104 and so on..