Skip to content

Commit cfe77cc

Browse files
committed
mouredev#2 - Python
1 parent 15c5b69 commit cfe77cc

File tree

1 file changed

+23
-0
lines changed
  • Roadmap/02 - FUNCIONES Y ALCANCE/python

1 file changed

+23
-0
lines changed

Roadmap/02 - FUNCIONES Y ALCANCE/python/saezMD.py

+23
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,29 @@ def all(iterable):
8080
all("home")
8181
# all(0) ; FALSE
8282

83+
# Variables Globales y locales
84+
85+
counter = 10
86+
87+
def restartCounter():
88+
global counter
89+
counter = 0
90+
91+
92+
print(f'counter before is {counter}')
93+
restartCounter()
94+
print(f'counter after is {counter}')
95+
96+
97+
value = 10
98+
99+
def func10():
100+
value = 20
101+
print(f'Inside value: {value}')
102+
103+
104+
func10()
105+
print(f'Outside value: {value}')
83106

84107
"""
85108
DIFICULTAD EXTRA (opcional):

0 commit comments

Comments
 (0)