Contenido del Curso
Intermediate Python: Arguments, Scopes and Decorators
Intermediate Python: Arguments, Scopes and Decorators
Challenge: Modifying a Global Variable
Tarea
This task shows how you can modify a global variable from within a function using the global keyword.
- Use the keyword global for receiving access to modify
global_var
; - Increase
global_var
value on to 5; - Call the function
modify_global
to implement changes; - Print modified
global_var
.
¡Gracias por tus comentarios!
Challenge: Modifying a Global Variable
Tarea
This task shows how you can modify a global variable from within a function using the global keyword.
- Use the keyword global for receiving access to modify
global_var
; - Increase
global_var
value on to 5; - Call the function
modify_global
to implement changes; - Print modified
global_var
.
¡Gracias por tus comentarios!
Challenge: Modifying a Global Variable
Tarea
This task shows how you can modify a global variable from within a function using the global keyword.
- Use the keyword global for receiving access to modify
global_var
; - Increase
global_var
value on to 5; - Call the function
modify_global
to implement changes; - Print modified
global_var
.
¡Gracias por tus comentarios!
Tarea
This task shows how you can modify a global variable from within a function using the global keyword.
- Use the keyword global for receiving access to modify
global_var
; - Increase
global_var
value on to 5; - Call the function
modify_global
to implement changes; - Print modified
global_var
.