#!/usr/bin/python3

# Sample
# python3 palindrome.py "Dabale arroz a la zorra el Abad"
# python3 palindrome.py "Anita lava la tina"

import sys

def checkPalindrome(str):
	str = str.replace(" ", "")

	if len(str) <= 1:
		return True

	if str[0].lower() != str[-1].lower():
		return False

	return checkPalindrome(str[1:-1])

print(f"Is '{sys.argv[1]}' a Palindrome?")
print(checkPalindrome(sys.argv[1]))

By horaz

My name is Horacio Conde, a computer science engineer and an apprentice maker I live in Mexico City and I've been working professionally in software development for more than twenty years now. I'm interested in technologies such as The Internet of Things (IoT) (Arduino, Raspberry Pi), electronics, physical computing, automation, woodworking and similar stuff.

Leave a Reply

Your email address will not be published. Required fields are marked *