Exec di dalam def tidak berfungsi di Python

def better():
    d = {}
    exec("x=23", d)
    return d['x']

print better()
23
Sparkling Sable