# -*- coding: utf-8 -*-
# 교재 scoping_rule_final.py
def calculate(x, y):
    total = x + y                    
    print("In Function")
    print("a:", a, "b:", b, "a + b:", a+b, "total:", total)
    return total

a = 5                               # a와 b는 전역 변수
b = 7
total = 0                           # 전역 변수 total
print("In Program - 1")
print("a:", a, "b:", b, "a + b:", a+b)

sum = calculate (a, b)
print("After Calculation")
print("Total:", total, " Sum:", sum) 