Question of the day (python) 25th Aug

Q. Write a program for checking a palindrome number.
Eg: 1221, 4334, 171 are palindrome numbers

2 Likes

data = (input((“Enter the data:”)))

backwards = data[::-1]
if data == backwards:
print(“The given data is a palindrome”)
else:
print(“The given data is not a palindrome”)

2 Likes

a = input(‘Input a number to check whether its a palindrome or not:’)
b = a[::-1]

if a == b :
print(f’{a} is a Palindrome number’)
else:
print(f’{a} is not a Palindrome number’)

1 Like