diff --git a/_posts/Python/Scope and Name/2022-01-23-Global-Scope.md b/_posts/Python/Scope and Name/2022-01-23-Global-Scope.md index 198bba4..3c0604c 100644 --- a/_posts/Python/Scope and Name/2022-01-23-Global-Scope.md +++ b/_posts/Python/Scope and Name/2022-01-23-Global-Scope.md @@ -136,15 +136,17 @@ first.X=88 ```python X = 99 -def setX() : +def setX(num) : global X - X = 88 + X = num + # X = 88 ``` ```python import first -first.setX() +num = 88 +first.setX(num) print(first.X) ```