forked from PlatziMaster/challenge-python-01
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChallenge_1.py
More file actions
43 lines (32 loc) · 821 Bytes
/
Challenge_1.py
File metadata and controls
43 lines (32 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
PALINDROMES = [
'Acaso hubo buhos aca',
'A la catalana banal atacala',
'Amar da drama',
]
NOT_PALINDROMES = [
'Hola como estas',
'Platzi'
'Oscar',
]
def is_palindrome(palindrome):
palabra = palindrome[::-1].lower()
original = palindrome.replace(" ", "")
original = original.lower()
palindromoo = palabra.replace(" ", "")
if original == palindromoo:
return True
def validate():
for palindrome in PALINDROMES:
if not is_palindrome(palindrome):
return False
for not_palindrome in NOT_PALINDROMES:
if is_palindrome(not_palindrome):
return False
return True
def run():
if validate():
print('Completaste el test')
else:
print('No completaste el test')
if __name__ == '__main__':
run()