CBSE Class 12 Computer Science
Question 12 of 42
Solved 2024 Sample Question Paper CBSE Class 12 Computer Science (083) — Question 12
Back to all questions 12
Question global b
Reason — When we want to modify a global variable within a function in Python, we need to use the global keyword followed by the name of the global variable. In this case, since the variable b is declared as a global variable outside the function, we need to declare it as a global variable again inside the function using global b before attempting to modify its value.