Код: Выделить всё
import sys
def isPalindrome(test):
if len(test) == 1:
return("Is a palindrome")
else:
if test[0] == test[-1]:
isPalindrome(test[1:-1])
else:
return("Not a palindrome")
print(isPalindrome(sys.argv[1]))
Подробнее здесь: https://stackoverflow.com/questions/298 ... -in-python
Мобильная версия