We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e59778 commit 668c120Copy full SHA for 668c120
1 file changed
09_Global_local.py
@@ -4,7 +4,7 @@ def greet():
4
print(msg)
5
6
greet()
7
-
+"""print("Outside:", msg)""" # This will raise an error since msg is not defined outside the function
8
9
# global variables
10
msg = "Hello"
@@ -16,11 +16,11 @@ def greet_global():
16
17
18
def fun():
19
- print("Inside Function", s)
+ print("Inside Function: ", s)
20
21
s = "I love Geeksforgeeks"
22
fun()
23
-print("Outside Function", s)
+print("Outside Function: ", s)
24
25
26
# Modifying Global Variables Inside a Function
@@ -30,4 +30,4 @@ def fun():
30
print(s)
31
s = "I love Geeksforgeeks "
32
33
0 commit comments