Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solves issue #3488 #3660

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

solves issue #3488 #3660

wants to merge 6 commits into from

Conversation

kss682
Copy link

@kss682 kss682 commented Aug 31, 2018

Fixes issue:

This PR solves the issue #3488.

Changes:

Changes made in the functions: base_check and palindrome .
Also binary with leading zeros are eliminated.

@mansiag
Copy link
Contributor

mansiag commented Oct 1, 2018

Please follow the coding style guide and make changes according to it.

ans += str(a % y)
a = a // y
return ans == ans[::-1]
ans =0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add spaces between operator and operands

a = a // y
return ans == ans[::-1]
ans =0
while a!=0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

return ans == ans[::-1]
ans =0
while a!=0:
ans=ans*10+a % y
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

while a!=0:
ans=ans*10+a % y
a = a // y

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove extra newlines

print(answer)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove extra newlines

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes have been made.

mansiag
mansiag previously approved these changes Oct 1, 2018
@@ -12,7 +12,7 @@ def palindrome(x):
while x ! = 0:
reverse = reverse * 10 + x % 10
x = x // 10
if reverse==num:
if reverse = = num:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use reverse == num

def base_check(a, y):
ans = 0
while a ! = 0:
ans = ans * 10 + a % y
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ans = ans*10 + a%y

return x == x[::-1]
def base_check(a, y):
ans = 0
while a ! = 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a != 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants