using System;using System.Linq;namespace palindrome{class Program{publicstaticboolcheckPalindrome(string mainString){string firstHalf=mainString.Substring(0,mainString.Length/2);char[]arr=mainString.ToCharArray();Array.Reverse(arr);string temp=newstring(arr);string secondHalf=temp.Substring(0,temp.Len...
join(c.lower() for c in s if c.isalnum()) return s == s[::-1] # Check and print the result if is_palindrome(word): print("Palindrome") else: print("Not Palindrome") The program begins by obtaining a string input from the user using the input() function. The is_palindrome ...
You can write a program to check if a number is a palindrome or not in Python. Methods to check if a number is a palindrome 1. Using simple iteration These steps can be used in Python to determine whether a number is a palindrome or not using basic iteration: Utilize the str() func...
long _Number = Convert.ToInt64(Console.ReadLine()); _Ravi._PlandromNumber(_Number); Console.ReadLine(); } private void _PlandromString(string _OldString) { string _NewString = string.Empty; try { for (int i = _OldString.Length - 1; i >= 0; i--) { _NewString += _OldString...