13. Write a Python program to Check whether the given number is Palindrome or Not from n number .

Solution :- 

 

Static :- 

lower = 200
upper = 400
for num in range(lower,upper+1):
temp = num
rev = 0
while temp >0:
rem = temp % 10
temp = temp //10
rev = (rev*10)+rem
if rev == num:
print(rev)

Output :- 

Dynamic :- 

lower = int(input(“Enter lower range:- “))
upper = int(input(“Enter upper range :- “))
for num in range(lower,upper+1):
temp = num
rev = 0
while temp >0:
rem = temp % 10
temp = temp //10
rev = (rev*10)+rem
if rev == num:
print(rev)

Output :-