list[::-1] 는 저장됨
list.reverse() 는 저장 안 됨
list.reverse() 는 바로 print 안 됨
list = [0,1,2,3,4]
list.reverse()
print(list)
list = [0,1,2,3,4]
print(list[::-1])
https://codetorial.net/tips_and_examples/reverse_python_list_or_numpy_array.html
3. 파이썬 리스트 순서 뒤집기 - Codetorial
4) np.flip() vs np.flipud() vs np.fliplr() np.flip(), np.flipud(), np.fliplr() 메서드의 차이에 대해 알아봅니다. 2차원 어레이에서 세가지 메서드는 다르게 동작합니다. np.flip() vs np.flipud() vs np.fliplr(). np.flip()은
codetorial.net
'알고리즘 > Tip for Python' 카테고리의 다른 글
리스트 컴프리헨션 (0) | 2023.04.21 |
---|---|
divmod() (0) | 2023.04.21 |
numpy 라이브러리 - 평균 구하기 (0) | 2023.04.21 |
짝수의 합 구하기 (1) | 2023.04.21 |
실수의 정수, 실수 부분 구하기 (0) | 2023.04.21 |