Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jennyonjourney/aaa2da9bb0a42f5c1820f05423974744 to your computer and use it in GitHub Desktop.
Save jennyonjourney/aaa2da9bb0a42f5c1820f05423974744 to your computer and use it in GitHub Desktop.
Python - function practice2
ppp=""
def fn1():
global ppp
pre = ppp
ppp+="\t"
a=10
print(pre+"fn1() 시작",a)
fn2();
print(pre+"fn1() 끝",a)
def fn2():
global ppp
pre = ppp
ppp += "\t"
print(pre+"fn2() 시작")
fn3();
print(pre+"fn2() 끝")
def fn3():
global ppp
pre = ppp
ppp += "\t"
print(pre+"fn3() 시작")
print(pre+"fn3() 끝")
fn1()
#세미콜론으로 서로 다른 함수를 이끌어오는것
#지역변수는 공유가 불가능함.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment