Challenge: Modifying a Global Variable in Python
Taak
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
.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 4. Hoofdstuk 3
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Awesome!
Completion rate improved to 3.7
Challenge: Modifying a Global Variable in Python
Veeg om het menu te tonen
Taak
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
.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Awesome!
Completion rate improved to 3.7Sectie 4. Hoofdstuk 3
single