You are viewing a single comment's thread. Return to all comments →
str = 'abc'
print(str[::-1])
--> 'cba'
arr = ['a', 'b', 'c']
print(arr[::-1])
--> ['c', 'b', 'a']
Seems like cookies are disabled on this browser, please enable them to open this website
Designer Door Mat
You are viewing a single comment's thread. Return to all comments →
str = 'abc'
print(str[::-1])
--> 'cba'
arr = ['a', 'b', 'c']
print(arr[::-1])
--> ['c', 'b', 'a']