-
-
Save parzibyte/f2b7d51c6e3c31f9fe172f150b157933 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 empieza_con(cadena, subcadena): | |
longitud_subcadena = len(subcadena) | |
extraido = cadena[0:longitud_subcadena] | |
if extraido == subcadena: | |
return True | |
else: | |
return False | |
print(empieza_con("Hola", "H")) # True | |
print(empieza_con("Hola", "h")) # False | |
print(empieza_con("Parzibyte", "e")) # False | |
print(empieza_con("Me gusta programar en Python desde parzibyte.me", "Me gu")) # True | |
print(empieza_con("Hola", "Hola mundo")) # False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment