Python Methods and Functions
Input: n = 9 Output: True Binary representation of n = 9 is 1001 which is palindrome as well. Input: n = 10 Output: False Binary representation of n = 10 is 1010 which is not palindrome.
We have a solution to this problem, please refer to bin (num) . Now flip the string of the binary representation of the number and compare it with the original represented binary string, if both values are equal, that means the binary representation of the number is a pallindrome, otherwise it is not. li>
Note: we can use a different approach checking the string — palindrome or not .