summaryrefslogtreecommitdiff
path: root/python/palindroma.py
blob: af82a041916e91ae671961941b47e08bd81cbdae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
def palindromo(parola, start, end):
    if start >= end:
        return True
    elif parola[start] == parola[end]:
        return palindromo(parola, start+1 , end-1)
    else:
        return False


parola = input('Parola: ')

if palindromo(parola, 0, len(parola)-1):
    print('Palindroma')
else:
    print('Non palindroma')