Jak odwrócić sznur w Pythonie
# in order to make a string reversed in python
# you have to use the slicing as following
string = "racecar"
print(string[::-1])
Tejas Naik
# in order to make a string reversed in python
# you have to use the slicing as following
string = "racecar"
print(string[::-1])
str="Python" # initial string
stringlength=len(str) # calculate length of the list
slicedString=str[stringlength::-1] # slicing
print (slicedString) # print the reversed string
'hello world'[::-1]
'dlrow olleh'
s = "001100"
for x in s[len(s)-1::-1]:
print(x)
'hello world'[::-1]
# 'dlrow olleh'
word = "hello world"
r_word = "".join(reversed(word))
print(r_word)