Global: Difference between revisions

From Helpful
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{#addbodyclass:tag_tech}}
{{#addbodyclass:tag_prog}}
<!--
<!--


Line 4: Line 6:




In python, the {{inlinecode|global}} keyword lets you write to global scope (you can always read it)
In python, the {{inlinecode|global}} keyword lets you write to global scope (variables from the global scope are always visible in narrower scopes, but python assumes that assigning to a variable should be a local variable ''unless declared otherwise'')
 
 
 
 
 
 


nonlocal was added later for a similar reason.





Latest revision as of 12:21, 17 May 2024