티스토리 뷰

PL/Python

파이썬 string reverse 하기

SweetDev 2021. 1. 28. 18:26

www.w3schools.com/python/python_howto_reverse_string.asp

 

How to reverse a String in Python

How to Reverse a String in Python Learn how to reverse a String in Python. There is no built-in function to reverse a String in Python. The fastest (and easiest?) way is to use a slice that steps backwards, -1. Example Reverse the string "Hello World": txt

www.w3schools.com

 

str[::-1]

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2026/05   »
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
31
글 보관함