# Python program to check prime number# Function to check prime numberdefisPrime(n):returnall([(n%j)forjinrange(2,int(n/2)+1)])andn>1# Main codenum=59ifisPrime(num):print(num,"is a prime number")else:print(num,"is not a prime number")num=7ifisPrime(num):print(num,"is a ...
Check Palindrome in Python Using List Slicing Example # Enter stringword=input()# Check for palindrome strings using list slicingifstr(word)==str(word)[::-1]:print("Palindrome")else:print("Not Palindrome") The program begins by prompting the user to input a string using theinput()function...
Here, we are going to learn how to check whether a given number is palindrome or not in JavaScript.
Python Examples Add Two Matrices Transpose a Matrix Multiply Two Matrices Check Whether a String is Palindrome or Not Remove Punctuations From a String Sort Words in Alphabetic Order Illustrate Different Set Operations Count the Number of Each Vowel Python Tutorials Python List reverse() ...
11. Check if a Number is PerfectWrite a Python function to check whether a number is "Perfect" or not.According to Wikipedia : In number theory, a perfect number is a positive integer that is equal to the sum of its proper positive divisors, that is, the sum of its positive divisors ...
Learn how to check if a given number is a perfect number in Java with this simple guide and example code.
How to check if String is Palindrome using C#? C# program to check if a string is palindrome or not Python program to check if a string is palindrome or not Python program to check if a given string is number Palindrome Recursive function to check if a string is palindrome in C++ JavaScr...
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...
I was once stucked in How to check Whether a Python module has been installed or not. After Googling, I found this trick. Python allows user to pass command from out of a python file.See here The resu...Determine whether an integer is a palindrome. Do this without extra space. Some ...
Here is source code of the Python Program to check whether a string is a palindrome or not using recursion. The program output is also shown below. defis_palindrome(s):iflen(s)<1:returnTrueelse:ifs[0]==s[-1]:returnis_palindrome(s[1:-1])else:returnFalsea=str(input("Enter string:...