- 1
To check whether the number is palindrome or not and return y or n accordingly
9 Answers
+ 1
hint:
*no need to convert str
*what is palindrome? hm?
*forward backward... got it?
+ 1
Many of this community CAN solve this O-N-E...
But they don't want.
there is difference between want and cant
We can but dont want
You want but cant
Cabish?
0
Homework? Where is your attempt?
0
num = int(input("Enter a number: "))
def palindrome(num):
temp = n
rev = 0
while (n > 0):
digit = n % 10
rev= rev*10+dig
n=n//10
if (temp==rev):
return "yes"
else:
return "no"
print(num,"\nis an palindrome number ")
print(palindrome(num))
0
I have tried but this is not working
0
Even i am confused in this pls let me know if anyone can solve this one..
0
Oh ohk thats so sadđđ
0
num = int(input("Enter a number: "))
def palindrome(n):
temp = n
rev = 0
while (n > 0):
digit = n % 10
rev= rev*10+dig
n=n//10
if (temp==rev):
return "yes"
else:
return "no"
print(num,"\nis an palindrome number ")
print(palindrome(num))
#You need to understand code each part first..
0
Do a little modify to satisfy your need.
https://code.sololearn.com/c18Ltdc8It25/?ref=app