├── src └── main.py ├── LICENCE ├── README.md └── .gitignore /src/main.py: -------------------------------------------------------------------------------- 1 | # Resolve the problem!! 2 | 3 | PALINDROMES = [ 4 | 'Acaso hubo buhos aca', 5 | 'A la catalana banal atacala', 6 | 'Amar da drama', 7 | ] 8 | 9 | NOT_PALINDROMES = [ 10 | 'Hola como estas', 11 | 'Platzi' 12 | 'Oscar', 13 | ] 14 | 15 | 16 | def is_palindrome(palindrome): 17 | # Start coding here 18 | pass 19 | 20 | def validate(): 21 | for palindrome in PALINDROMES: 22 | if not is_palindrome(palindrome): 23 | return False 24 | 25 | for not_palindrome in NOT_PALINDROMES: 26 | if is_palindrome(not_palindrome): 27 | return False 28 | return True 29 | 30 | 31 | def run(): 32 | if validate(): 33 | print('Completaste el test') 34 | else: 35 | print('No completaste el test') 36 | 37 | 38 | if __name__ == '__main__': 39 | run() 40 | -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Platzi Master 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # challenge-python-01 - Palíndromo 2 | 3 | Un palíndromo es una palabra o frase que puede leerse igual al derecho y al revés, como "oso", "ana", "amad a la dama", etc. 4 | 5 | ### RETO 6 | 7 | Completa la función **is_palindrome** y corre tu script. La misma debe retornar True en caso de recibir un palíndromo como argumento, o False si se trata de lo contrario. Si recibes el output "Completaste el test" estás listo para hacer un pull request! 8 | 9 | Aclaraciones: 10 | 11 | - **No modifiques la función `validate`** 12 | - No necesitas instalar nada ni crear un entorno virtual, ya que todos los módulos que puedes usar vienen en el core de Python 13 | - Utiliza Python 3 para resolver el reto 14 | - ¡No leas las soluciones de tus compañeros! Es importante que te retes a ti mismo y pruebes tus habilidades 15 | 16 | ### Pistas 17 | 18 | - No consideres los espacios a la hora de determinar si un string es un palíndromo o no 19 | - "Ana" es un palíndromo, 'anA' también 20 | 21 | ### Enviar solución 22 | 23 | Debes hacer un "Fork" de este proyecto, revolver los problemas y crear un Pull Request hacia este repositorio. 24 | 25 | ### Contribuir 26 | 27 | Si alguien quiere agregar o mejorar algo, puede hacerlo directamente en este repositorio: [challenge-python-01](https://github.com/platzimaster/challenge-python-01/) 28 | 29 | ### Licencia 30 | 31 | challenge-python-01 se lanza bajo la licencia [MIT](https://opensource.org/licenses/MIT). 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Problem resolved archives 2 | 3 | resolve.py 4 | 5 | # Byte-compiled / optimized / DLL files 6 | __pycache__/ 7 | *.py[cod] 8 | *$py.class 9 | 10 | # C extensions 11 | *.so 12 | 13 | # Distribution / packaging 14 | .Python 15 | build/ 16 | develop-eggs/ 17 | dist/ 18 | downloads/ 19 | eggs/ 20 | .eggs/ 21 | lib/ 22 | lib64/ 23 | parts/ 24 | sdist/ 25 | var/ 26 | wheels/ 27 | pip-wheel-metadata/ 28 | share/python-wheels/ 29 | *.egg-info/ 30 | .installed.cfg 31 | *.egg 32 | MANIFEST 33 | 34 | # PyInstaller 35 | # Usually these files are written by a python script from a template 36 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 37 | *.manifest 38 | *.spec 39 | 40 | # Installer logs 41 | pip-log.txt 42 | pip-delete-this-directory.txt 43 | 44 | # Unit test / coverage reports 45 | htmlcov/ 46 | .tox/ 47 | .nox/ 48 | .coverage 49 | .coverage.* 50 | .cache 51 | nosetests.xml 52 | coverage.xml 53 | *.cover 54 | *.py,cover 55 | .hypothesis/ 56 | .pytest_cache/ 57 | 58 | # Translations 59 | *.mo 60 | *.pot 61 | 62 | # Django stuff: 63 | *.log 64 | local_settings.py 65 | db.sqlite3 66 | db.sqlite3-journal 67 | 68 | # Flask stuff: 69 | instance/ 70 | .webassets-cache 71 | 72 | # Scrapy stuff: 73 | .scrapy 74 | 75 | # Sphinx documentation 76 | docs/_build/ 77 | 78 | # PyBuilder 79 | target/ 80 | 81 | # Jupyter Notebook 82 | .ipynb_checkpoints 83 | 84 | # IPython 85 | profile_default/ 86 | ipython_config.py 87 | 88 | # pyenv 89 | # For a library or package, you might want to ignore these files since the code is 90 | # intended to run in multiple environments; otherwise, check them in: 91 | # .python-version 92 | 93 | # pipenv 94 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 95 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 96 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 97 | # install all needed dependencies. 98 | #Pipfile.lock 99 | 100 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 101 | __pypackages__/ 102 | 103 | # Celery stuff 104 | celerybeat-schedule 105 | celerybeat.pid 106 | 107 | # SageMath parsed files 108 | *.sage.py 109 | 110 | # Environments 111 | .env 112 | .venv 113 | env/ 114 | venv/ 115 | ENV/ 116 | env.bak/ 117 | venv.bak/ 118 | 119 | # Spyder project settings 120 | .spyderproject 121 | .spyproject 122 | 123 | # Rope project settings 124 | .ropeproject 125 | 126 | # mkdocs documentation 127 | /site 128 | 129 | # mypy 130 | .mypy_cache/ 131 | .dmypy.json 132 | dmypy.json 133 | 134 | # Pyre type checker 135 | .pyre/ 136 | 137 | # pytype static type analyzer 138 | .pytype/ --------------------------------------------------------------------------------