Skip to content

Instantly share code, notes, and snippets.

@azdafirmansyah
Last active November 30, 2017 06:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azdafirmansyah/d10a903762c19bec367c1f6ad764a44b to your computer and use it in GitHub Desktop.
Save azdafirmansyah/d10a903762c19bec367c1f6ad764a44b to your computer and use it in GitHub Desktop.
String List Reverse
#Exercise URL : http://www.practicepython.org/exercise/2014/03/12/06-string-lists.html
'''
Ask the user for a string and print out whether this string is a palindrome or not.
(A palindrome is a string that reads the same forwards and backwards.)
'''
data = str(input("Input your word : \n > "))
temp = ""
for i in range(len(data)):
temp += data[(len(data)-1)-i]
print("Original Word : ",data)
print("Reverse Word : ",temp)
if data == temp:
print("Same Word")
else:
print("Different Word")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment