How to reverse strings in Python

Опубликовано: 28 Май 2026
на канале: 60 Second How-to
35
1

Subscribe for more
#howto #python #pythonprogramming #pythontutorial #reversestrings #stringsinpython #tutorial #1minutevideo #60secondsvideo #fasttutorial #beginners #coding #developer

Full Code Snippet

Example 1:
--------------------------
s = "123456789"
reverse_s = s[::-1]
print(reverse_s)

Example 2:
-------------------------
s = "123456789"

def reverse(s):
str = ""
for i in s:
str = i + str
return str

new_str = reverse(s)

print(new_str)