Skip to content

Adding a "Palindrome Problem"#1

Description

@GopalDwivedii

Enhanced Update馃幆

  • Adding a Palindrome Number Problem to your comprehensive python workbook, which is pretty famous in company interviews :
    essentially it is,

To check weather a number is same as it was when written backwards

num=int(input("Enter a number"))
origin=num
rev=0
while num > 0:
digit = num %10
rev = rev * 10 + digit
num //=10

if origin == rev:
print("Number is a Palindrome")
else:
print("Not a palindrome")

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions