1
2
3
4
5
6
def foo():
    bar = 5
    baz = 6
    print locals()['bar']
    
foo()