Q. Given list of integer, write a program to find those which are palindromes.
You can understand by Watching video :-
Answer :-
while True : a = input("Enter a number (for quit enter q )= ") if a == "q" or a== "Q" : break else : reverse = a[ -1 : - len(a) - 1 : - 1] if a == reverse : print(a,"is palindromes of ",reverse) else : print(a,"is not palindromes of ",reverse)
Output :-
Enter a number (for quit enter q )= 12321
12321 is palindromes of 12321
Enter a number (for quit enter q )= 5894
5894 is not palindromes of 4985
Enter a number (for quit enter q )= 5123
5123 is not palindromes of 3215
Enter a number (for quit enter q )= 78987
78987 is palindromes of 78987
Enter a number (for quit enter q )= q
>>>
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )