shubham3git
12/10/2018 - 12:13 PM

String Lists

String Lists

#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.)
s=str(input("Enter a string to check whether this string is a palindrome or not\n"))
if s == s[::-1]:
    print("string is a palindrome")
else:
    print("string is not a palindrome")