0
Write a program to print and check that no. Is palindrome or not.
(In python language)
5 Réponses
+ 1
No Limit you shouldn't just be asking people to write programs for you, it's more like asking people to do your homework for you (even if that's not what it is)
You should first of attempt the challenge, and then ask questions wherever you get stuck.
You'll learn better that way
+ 4
You can do it like Dejan Francuz, or like this
num = input()
if num == num[::-1]:
print("Palindrome")
+ 2
Thomas Williams yeah 🤣
+ 1
Hi there,
So to check if number is palindrome or not you have to check the entered number in reversed way, code for that is:
number = int(input())
reverse = 0
while(number >0):
reminder = number % 10
reverse = (reverse * 10) + reminder
number = number // 10
Now you can just check with if statement if entered number is equal to reversed.
+ 1
n=int(input("enter"))
temp=n
m=0
while (n! =0) :
k=n%10
m=m*10+k
n=n//10
print(m)
if m==temp:
print("no.is palindrome ")
else:
print (" no. is not palindrome ")