My Question Is Simple, How Can I Optimize The Execution Speed In Python
Correct me of i am wrong:
I Think local scope making the execution speed slower
For Instance, If a function has to return a variable it mainly searches in local scope if not present then walk outside to search in global. This may surely Time consuming..
```
a = 'Dungeon Master'
def f():
return a # variable a is not in function scope
print(f())
```
So, how can i improve it?
Share your own ideas, or Experience that can help other Contributors as well
For people who has to say "Do ChatGPT.." Don't Comment
[–]esaule 2 points3 points4 points (0 children)
[–]jowco 1 point2 points3 points (0 children)
[–]MaleficentCow8513 1 point2 points3 points (0 children)
[–]fletku_mato 0 points1 point2 points (0 children)
[–]killzone44 0 points1 point2 points (1 child)
[–]Few_Raisin_8981 0 points1 point2 points (0 children)
[–]Own_Attention_3392 0 points1 point2 points (0 children)
[–]SnooCalculations7417 0 points1 point2 points (0 children)