From 11267a9283d152020f5085372a2e0b3ad28c6306 Mon Sep 17 00:00:00 2001 From: woongjoonchoi Date: Fri, 27 Oct 2023 19:20:22 +0900 Subject: [PATCH] modify woongjoonchoi.github.io/_posts/Python/Scope and Name/2022-01-23-Global-Scope.md modify change global name example code --- _posts/Python/Scope and Name/2022-01-23-Global-Scope.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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) ```