You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnf"Hola, mi nombres {nombre}, tengo {edad} años"
19
+
20
+
# Se pueden usar funciones dentro de funciones?
21
+
deffuncion_externa(a:float, b:float):
22
+
deffuncion_interna(c:float):
23
+
returnc**2
24
+
returna*funcion_interna(b)
25
+
26
+
print(funcion_externa(2,2))
27
+
28
+
# Tambien es aplicable para hacer recursividad, sin embargo este concepto trata de que usamos la misma funcion para obtener algun rasultado, sin necesidad de una funcion interna
29
+
30
+
#factorial
31
+
deffactorial(n:int):
32
+
ifn>0:
33
+
ifn==0orn==1:
34
+
return1
35
+
else:
36
+
returnn*factorial(n-1)
37
+
else:
38
+
returnNone
39
+
40
+
print(factorial(5))
41
+
42
+
#Funciones integradas en python:
43
+
length=len('Hola como estas?')
44
+
# funciones para hacer casting float(), list(), int(), str()
0 commit comments