diff --git a/binaryofnoispalindromeornot.py b/binaryofnoispalindromeornot.py new file mode 100644 index 0000000..7afe479 --- /dev/null +++ b/binaryofnoispalindromeornot.py @@ -0,0 +1,14 @@ +# input the number +P=int(input('Enter a number: ')) + +# converting to binary +s=int(bin(P)[2:]) + +# reversing the binary +r=str(s)[::-1] + +# checking the palindrome +if int(r)==s: + print("The binary representation of the number is a palindrome.") +else: + print("The binary representation of the number is not a palindrome.")