Advertisement
svephoto

Palindrome Integers [Python]

Nov 28th, 2021
1,016
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. listOfNumbers = input().split(", ")
  2.  
  3. for i in range(len(listOfNumbers)):
  4.     current_number = str(listOfNumbers[i])
  5.     is_palindrome = ""
  6.  
  7.     for digit in reversed(current_number):
  8.         is_palindrome += digit
  9.  
  10.     if current_number == is_palindrome:
  11.         print("True")
  12.     else:
  13.         print("False")
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement