-
Notifications
You must be signed in to change notification settings - Fork 18.2k
Feature/new python answers #191
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
Feature/new python answers #191
Conversation
Added new questions related with KVM, Libvirt and DNF
| def isNumberPalindrome(number: int | str) -> bool: | ||
| if isinstance(number, int): | ||
| number = str(number) | ||
| return number == number[::-1] |
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.
This perhaps the shortest way to do so, but we might want to specify that it's not the fastest
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.
To clarify, I meant [::-1], not the bitwise operator
| def isNumberPalindrome(number: int | str) -> bool: | ||
| if isinstance(number, int): | ||
| number = str(number) | ||
| return number == number[::-1] |
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.
To clarify, I meant [::-1], not the bitwise operator
* New questions and spell check (bregman-arie#181) Added new questions related with KVM, Libvirt and DNF * New answers * Adding a note about which way is faster: Union vs Bitwise * Add comment about slicing vs reversed
No description provided.