Skip to content

Instantly share code, notes, and snippets.

@andriiburka
Created February 6, 2020 14:44
Show Gist options
  • Save andriiburka/aae4c107da9171b920a112c630172e82 to your computer and use it in GitHub Desktop.
Save andriiburka/aae4c107da9171b920a112c630172e82 to your computer and use it in GitHub Desktop.
Comprehension ver.
def foo_palindromic_check(str_in):
for number in str_in:
is_palindromic = [number[i - 1] for i in range(1, int(len(number) / 2) + 1)] ==\
[number[-i2] for i2 in range(1, int(len(number) / 2) + 1)]
print(is_palindromic)
string_in = input().split(', ')
foo_palindromic_check(string_in)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment