Aug 16, 2024
Python program to accept string from user and reverse it.
word=input(“Inpute a word to reverse:”)
Inputer a word to reverse:Python
for c in range(len(word) -1,-1,-1):
print(word[c], end=””)
Output:
nohtyP
Python program to accept string from user and reverse it.
word=input(“Inpute a word to reverse:”)
Inputer a word to reverse:Python
for c in range(len(word) -1,-1,-1):
print(word[c], end=””)
Output:
nohtyP