Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change result to resultado
  • Loading branch information
nelsoncardenas committed Oct 29, 2021
commit 0f24ea9d4553994097ccee4414b31a149b90a445
4 changes: 2 additions & 2 deletions global_&_return.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ La función anterior toma dos argumentos de entrada y como salida devuelve su su

def suma(valor1, valor2):
global resultado
result = valor1 + valor2
resultado = valor1 + valor2

suma(3,5)
print(resultado)
Expand All @@ -43,7 +43,7 @@ Por otro lado, hemos visto como se puede hacer uso de ``global``. Por norma gene
# fuera
Traceback (most recent call last):
File "", line 1, in
result
resultado
NameError: name 'resultado' is not defined

# Ahora vamos a hacer lo mismo pero declarando la función
Expand Down