Browse Source

Add files via upload

PythonCoder8 4 years ago
parent
commit
68a684cf6a
1 changed files with 8 additions and 0 deletions
  1. 8 0
      palindrome-alternative.py

+ 8 - 0
palindrome-alternative.py

@@ -0,0 +1,8 @@
+text = input('Enter any text or number: ')
+class Solution(object):   
+    def isPalindrome(self,x):
+        if str(x)[::-1] == str(x):
+            return f'The text "{str(x)}"is a palindrome.'
+        else:
+            return f'The text "{str(x)}" is not a palindrome.'
+print(Solution().isPalindrome(text))