This article teaches us to check if string/number is a palindrome in JavaScript. Palindrome in JavaScript With Built-in Functions JavaScript provides several functions that we can use to detect whether a string is a palindrome or not. First, convert the string into an array using thestring.spli...
# Enter input number or stringword=input()# Check if the string is a palindrome, ignoring case and spacesdefis_palindrome(s):s="".join(c.lower()forcinsifc.isalnum())returns==s[::-1]# Check and print the resultifis_palindrome(word):print("Palindrome")else:print("Not Palindrome") ...