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
base: master
Are you sure you want to change the base?
solves issue #3488 #3660
Conversation
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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 | ||
|
There was a problem hiding this comment.
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) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove extra newlines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes have been made.
@@ -12,7 +12,7 @@ def palindrome(x): | |||
while x ! = 0: | |||
reverse = reverse * 10 + x % 10 | |||
x = x // 10 | |||
if reverse==num: | |||
if reverse = = num: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a != 0
changes made in the coding style
Changes made in the coding style
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.