Write a Python program that accepts a word from the user and reverse it


Introduction

Write a Python program that accepts a word from the user and reverse it. I have used python 3.7 compiler for debugging purpose.


techstudy.org

HP 15 Core i3 7th gen Laptop(4GB, 1TB HDD, Windows 10) | Rs. 31,490

  1. word = input("Input a word to reverse: ")
  2.  
  3. for char in range(len(word) - 1, -1, -1):
  4. print(word[char], end="")
  5. print("\n")
  6.  

Result

python language techstudy.org

     





Related Topics




Popular Posts