Situatie
locals() method updates and returns the dictionary associated with the current local symbol table.
Solutie
Pasi de urmat
def localsNotPresent():
return locals()
def localsPresent():
present = True
return locals()
print(‘localsNotPresent:’, localsNotPresent())
print(‘localsPresent:’, localsPresent())
Output:
localsNotPresent: {}
localsPresent: {‘present’: True}
Leave A Comment?