fork download
  1. def sub(x,y):
  2. global a
  3. a=7
  4. x,y=y,x #x와 y의 자리 바꿈
  5. b=3
  6. print(a,b,x,y)
  7.  
  8. a,b,x,y = 1,2,3,4 #변수 선언
  9. print(a,b,x,y)
  10. sub(x,y)
  11. print(a,b,x,y)
Success #stdin #stdout 0.02s 27648KB
stdin
Standard input is empty
stdout
1 2 3 4
7 3 4 3
7 2 3 4