Skip to content

Commit 668c120

Browse files
committed
update global_local file
1 parent 8e59778 commit 668c120

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

09_Global_local.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ def greet():
44
print(msg)
55

66
greet()
7-
7+
"""print("Outside:", msg)""" # This will raise an error since msg is not defined outside the function
88

99
# global variables
1010
msg = "Hello"
@@ -16,11 +16,11 @@ def greet_global():
1616

1717

1818
def fun():
19-
print("Inside Function", s)
19+
print("Inside Function: ", s)
2020

2121
s = "I love Geeksforgeeks"
2222
fun()
23-
print("Outside Function", s)
23+
print("Outside Function: ", s)
2424

2525

2626
# Modifying Global Variables Inside a Function
@@ -30,4 +30,4 @@ def fun():
3030
print(s)
3131
s = "I love Geeksforgeeks "
3232
fun()
33-
print("Outside Function", s)
33+
print("Outside Function: ", s)

0 commit comments

Comments
 (0)