[파이썬] - 리스트의 역순_슬라이싱, reverse( )

zsunny·2022년 6월 23일
0

[Python] 문법

목록 보기
8/18

🔎 슬라이싱 [시작 : 끝 : step]

s = ["hello", "world"]
print(s[::-1])			// ["world", "hello"]

🔎 reverse ( )

  • 리스트 . reverse()
s = ["hello", "world"]
print(s.reverse())			// ["world", "hello"]
profile
매일 성장하는 예비 웹 개발자 🌱

0개의 댓글