Exec in Def arbeitet nicht in Python

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

print better()
23
Sparkling Sable