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 f(ht): | |
b = 0 | |
for elt in ht: | |
b = elt + b | |
return b |
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 m(k): | |
return (k % 2) == 0 |
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 s(m, n): | |
r = None | |
if m <= n: | |
r = m | |
else: | |
r = n | |
return r |
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 interes_anual(cantidad, interes): | |
return cantidad * (1 + interes / 100) | |
def retorno_inversion(cantidad, interes, anyos): | |
r = [] | |
for anyo in range(anyos): | |
cantidad = interes_anual(cantidad, interes) | |
r.append(round(cantidad, 2)) | |
return r |
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 applyToEachString(stringFunction, *words): | |
myList = [] | |
for word in words: | |
# ¿Qué instrucción debe ir aquí? | |
return tuple(myList) | |
def onlyVowels(word): | |
vowels = 'aeiouáéíóúü' | |
resp = "" | |
for letter in word: |
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 applyToEachString(stringFunction, *words): | |
myList = [] | |
for word in words: | |
# ¿Qué instrucción debe ir aquí? | |
return tuple(myList) |
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 what_i_do(p1, p2): | |
if p2 < len(p1): | |
return p1 | |
gap = (p2 - len(p1)) // 2 | |
return " " * gap + p1 |
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 second_scored(*lis): | |
maximum = max(lis) | |
preMax = min(lis) | |
for nombre in lis: | |
if (nombre < maximum and nombre > preMax): | |
preMax = nombre | |
return preMax | |
""" | |
-EL COMENTARIO- |
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 n(a): | |
return (a % 2) == 0 | |
def p(k): | |
return not n(k) |
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 g(xxs): | |
k = 1 | |
for elm in xxs: | |
k = k * elm | |
return k |
OlderNewer