KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Let's say I have this : def a(dict): locals().update(dict) print size def b(): size = 20 f(locals()) What do I have to do to access the size variable directly from the a function? I know of : size = dict["size"] but I think there should be a more direct way. I tried using locals().update(dict) but it didn't work. Is there a betteer way ?
Tags (comma-separated)
Save Edits
Cancel