반응형
시계방향
myL=[[0,1],[0,0]]
for i in range(4):
myL = list(map(list,zip(*myL[::-1]))) #90도 회전!
for j in myL:
print(j)
print()
[0, 0]
[0, 1]
[0, 0]
[1, 0]
[1, 0]
[0, 0]
[0, 1]
[0, 0]
반시계방향
myL=[[0,1],[0,0]]
for i in range(4):
myL = list(map(list,zip(*myL)))[::-1] #90도 회전!
for j in myL:
print(j)
print()
[1, 0]
[0, 0]
[0, 0]
[1, 0]
[0, 0]
[0, 1]
[0, 1]
[0, 0]
주의사항
그냥
외워
반응형