Challenge: Modifying a Global Variable in Python
Compito
Swipe to start coding
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
.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 4. Capitolo 3
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Awesome!
Completion rate improved to 3.7Awesome!
Completion rate improved to 3.7
Challenge: Modifying a Global Variable in Python
Compito
Swipe to start coding
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
.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 4. Capitolo 3
single
Awesome!
Completion rate improved to 3.7
Challenge: Modifying a Global Variable in Python
Scorri per mostrare il menu
Compito
Swipe to start coding
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
.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!