-
-
Save parzibyte/6cc55d101694dc3927cdb809738bb7c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def termina_con(cadena, subcadena): | |
longitud_subcadena = len(subcadena) | |
extraido = cadena[-longitud_subcadena:] | |
if extraido == subcadena: | |
return True | |
else: | |
return False | |
print(termina_con("parzibyte.me", "me")) # True | |
print(termina_con("parzibyte.me", "e")) # True | |
print(termina_con("Cuphead.exe", ".exe")) # True | |
print(termina_con("Cuphead.mp3", ".exe")) # False | |
print(termina_con("Hola mundo", "o")) # True | |
print(termina_con("Hola mundo", "O")) # False | |
print(termina_con("Hola mundo", "mundo")) # True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment